
---------------- gtk20.patch.lua，控件大致按照字母顺序（除个别存在前置依赖关系）

---------------------  GtkPageSetupUnixDialog
Gtk224.GtkPageSetupUnixDialog = {
  class = "GtkPageSetupUnixDialog", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_page_setup_unix_dialog_new((const gchar*)({* this.title.value *}), (GtkWindow*)({* this.parent.value *}))", 
            params = { type = {"const gchar*", "GtkWindow*"}, 
                       name = {"title", "parent"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
  },
  parent = Gtk224.GtkDialog,
  implement = {Gtk224.GtkBuildable}, 
  -- 还需要依赖其他的特殊模块
  ext_modules = {"gtk+-unix-print-2.0"},
  -- 此模块依赖的外部头文件
  ext_inc_files = {"gtk/gtkunixprint.h"},
};

---------------------  GtkPrintUnixDialog
Gtk224.GtkPrintUnixDialog = {
  class = "GtkPrintUnixDialog", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_print_unix_dialog_new((const gchar*)({* this.title.value *}), (GtkWindow*)({* this.parent.value *}))", 
            params = { type = {"const gchar*", "GtkWindow*"}, 
                       name = {"title", "parent"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
  },
  parent = Gtk224.GtkDialog,
  implement = {Gtk224.GtkBuildable}, 
  -- 还需要依赖其他的特殊模块
  ext_modules = {"gtk+-unix-print-2.0"},
  -- 此模块依赖的外部头文件
  ext_inc_files = {"gtk/gtkunixprint.h"},
};

function Gtk224.table_copy_table_in_patch(ori_tab)
  if (type(ori_tab) ~= "table") then
      return nil, 0
  end
  local new_tab = {}
  local max_index = 1
  for i,v in pairs(ori_tab) do
      local vtyp = type(v)
      if (vtyp == "table") then
          new_tab[i] = Gtk224.table_copy_table_in_patch(v)
      elseif (vtyp == "thread") then
          new_tab[i] = v
      elseif (vtyp == "userdata") then
          new_tab[i] = v
      else
          new_tab[i] = v
      end
  max_index = max_index + 1
  end
  return new_tab, max_index
end

-- 往表中插入多条记录
function Gtk224.insert_more(tbl, ...)
    local args = { ... }
    for _, item in ipairs(args) do
        table.insert(tbl, item);
    end
end;

-- 往表中插入多条记录
function Gtk224.copy_and_insert_more(tbl, ...)
  local args = { ... }
  local new_tbl = table.pack(table.unpack(tbl))
  -- 删除新表中的n字段
  new_tbl.n = nil;
  for _, item in ipairs(args) do
    table.insert(new_tbl, item);
  end
  return new_tbl;
end;

-- 对于某些特定的类，需要一个统一补丁函数，生成g_object_set的生成代码
function Gtk224.PatchGlibProperty(class, property_list)
  local function string_starts(String,Start)
      return string.sub(String,1,string.len(Start))==Start
  end
  local function string_ends(String,End)
      return End=='' or string.sub(String,-string.len(End))==End
  end
  local function item_is_in_table(name, tbl)
    for _, item in ipairs(tbl) do
        if name == item then
            return true
        end
    end
    return false
  end
  -- 传入类实例，直接进行Patch操作
  if class.property ~= nil then
      -- 优化一下传入property_list时的处理方式
      local check_property_list = class.property;
      -- 如果不为空，则可以做一个临时的小对象
      if property_list ~= nil and type(property_list) == "table" then
          check_property_list = {}
          for _, prop_name in ipairs(property_list) do
              if class.property[prop_name] == nil then
                  print("[ERROR] PatchGlibProperty fail, missing " .. prop_name " in " .. class.class)
              else
                check_property_list[prop_name] = class.property[prop_name]
              end
          end
      end
      for prop_name, property in pairs(check_property_list) do
          -- 跳过特殊字段
          if (not string_starts(prop_name, "__")) or (not string_ends(prop_name, "__")) then
              local real_prop_name = string.gsub(prop_name, "_", "-")
              -- 如果是处理全部属性，或者 指定了需要处理的属性
              if property_list == nil or item_is_in_table(prop_name, property_list) or item_is_in_table(real_prop_name, property_list) then
                    -- 如果生成代码为空，且rwflags为空或者为可读写rw
                    if property.__gencode__ == nil and (property.rwflags == nil or property.rwflags == "rw" or property.rwflags == "w") then
                        property.__gencode__ = {"g_object_set(G_OBJECT ({* id *}), \"" ..  real_prop_name .. "\", (".. property.__type__ .. ")({* property.value *}), NULL)"}
                    end
            end
          end
      end
  end
end

----------------==  GtkActivatable
----------------==  GtkBuildable
----------------==  GtkCellEditable
----------------==  GtkCellLayout
----------------==  GtkEditable
----------------==  GtkFileChooser
Gtk224.PatchGlibProperty(Gtk224.GtkFileChooser, {"file_system_backend"});

----------------==  GtkOrientable
----------------==  GtkPrintOperationPreview
----------------==  GtkRecentChooser
Gtk224.PatchGlibProperty(Gtk224.GtkRecentChooser, {"recent_manager"});

----------------==  GtkToolShell
----------------==  GtkTreeDragDest
----------------==  GtkTreeDragSource
----------------==  GtkTreeModel
----------------==  GtkTreeSortable

----------------==  GtkAccelGroup
----------------==  GtkAccelMap
----------------==  GtkAccessible
----------------==  GtkAction
-- GtkAction的构建以name为关键字，其label、tooltip、stock_id三个属性属于可选
Gtk224.GtkAction.property["name"]["__construct__"] = 1
Gtk224.GtkAction.property["label"]["__construct__"] = 1
Gtk224.GtkAction.property["tooltip"]["__construct__"] = 1
Gtk224.GtkAction.property["stock_id"]["__construct__"] = 1
Gtk224.PatchGlibProperty(Gtk224.GtkAction, {"hide_if_empty", "visible_overflown"});

----------------==  GtkActionGroup
Gtk224.GtkActionGroup.child_property = { 
    -- 属性名称  属性类型 缺省值
    key       = {__type__="gchar*"          ,__default__ = "F1"               , macro_code = {uisources = "ADD_ACCEL_TO_ACTION_GROUP"}},
    modifiers = {__type__="GdkModifierType" ,__default__ = "GDK_CONTROL_MASK" },
    label     = {__type__="gchar*"},
};


--[[
  类中的packing数据规则说明：
    1、packing表（数组格式）的每个子项都是一个表，顺序存放，判断需要哪些packing_build时，会先取得当前实例数据中所有的packing属性数据字段名称（name列表）
    2、packing子项(字典格式)中，group字段是一个数组，其中存放属性名，仅当当前实例packing属性数据中全部包含相应的属性名，才命中此子项条目
    3、命中条目后，会将子项的group_code（数组格式）依次拷贝packing_build用于输出代码，同时删除group_code中每个子项的name列表、filter_out列表
    4、删除后的name列表如果不为空，会继续下一packing子项的匹配，如果子项结束，但当前类存在父类，则递归继续匹配，直到全部匹配结束、或者父类为空
    5、生成代码时，packing_build列表内容是group_code子项的合并项，列表中每个子项都会进行处理并生成代码，每个packing_build子项结构与group_code子项结构完全一致
    6、packing_build子项在生成代码时会判断name字段中对应packing属性是否存在，如果不存在，则需要取得默认值，以供gen_code使用。
    7、如果name中的字段，有一项在packing属性中不存在，同时当前子项存在can_skip字段，则会跳过此条目的代码生成
]]--
Gtk224.GtkActionGroup["packing"] = {
    {
        -- 用于判断是否属于当前组
        group = {"key", "modifiers"}, group_code = { { name = {"key", "modifiers"},  
          gen_code = "ADD_ACCEL_TO_ACTION_GROUP((GtkActionGroup*){* id *}, (GtkAction*){* child.id.value *}, {* packing.key.value *}, (GdkModifierType)({* packing.modifiers.value *}))"},
        },
    },
    {
        -- 用于判断是否属于当前组
        group = {}, group_code = { { name = {},  
            gen_code = "gtk_action_group_add_action((GtkActionGroup*){* id *}, (GtkAction*){* child.id.value *})"},
        },
    },
};

----------------==  GtkBuilder
----------------==  GtkClipboard
----------------==  GtkEntryBuffer
Gtk224.GtkEntryBuffer.constructor.new.gencode = "gtk_entry_buffer_new((const gchar*)(NULL), (gint)(0))";
Gtk224.GtkEntryBuffer.property.text.__gencode__ = {"gtk_entry_buffer_set_text((GtkEntryBuffer*)({* id *}), (const gchar*)({* property.value *}), -1)"}

----------------==  GtkEntryCompletion
----------------==  GtkIMContext
----------------==  GtkIconFactory
Gtk224.GtkIconFactory.child_property = { 
    -- 属性名称  属性类型 缺省值
    stock_id    = {__type__="gchar*"},
};
Gtk224.GtkIconFactory.packing = {
    {
        -- 用于判断是否属于当前组
        group = {"stock_id"}, group_code = {
            { name = {"stock_id"},  gen_code = "gtk_icon_factory_add((GtkIconFactory*){* id *}, (const gchar*){* packing.stock_id.value *}, (GtkIconSet*){* child.id.value *})"},
            { name = {"stock_id"},  gen_code = "gtk_icon_set_unref((GtkIconSet*){* child.id.value *})"},
        },
    },
};
Gtk224.GtkIconSet = {
  class = "GtkIconSet", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_icon_set_new()", 
            params = { type = {}, name = {} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
  },
  packing = {
      {
          -- 用于判断是否属于当前组
          group = {}, group_code = {
              { name = {},  gen_code = "gtk_icon_set_add_source((GtkIconSet*){* id *}, (GtkIconSource*){* child.id.value *})"},
              { name = {},  gen_code = "gtk_icon_source_free((GtkIconSource*){* child.id.value *})"},
          },
      },
  },
  parent = nil, 
};
Gtk224.GtkIconSource = {
  class = "GtkIconSource", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_icon_source_new()", 
            params = { type = {}, name = {} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    filename   = {__type__="gchar*"           ,__default__ = "NULL",  __gencode__ = {"gtk_icon_source_set_filename((GtkIconSource*)({* id *}), (const gchar*)({* property.value *}))"} },
    icon_name  = {__type__="gchar*"           ,__default__ = "NULL",  __gencode__ = {"gtk_icon_source_set_icon_name((GtkIconSource*)({* id *}), (const gchar*)({* property.value *}))"} },
    size       = {__type__="GtkIconSize"      ,__default__ = "-1" ,   __gencode__ = {"gtk_icon_source_set_size((GtkIconSource*)({* id *}), (GtkIconSize)({* property.value *}))"} },
    direction  = {__type__="GtkTextDirection" ,__default__ = "-1" ,   __gencode__ = {"gtk_icon_source_set_direction((GtkIconSource*)({* id *}), (GtkTextDirection)({* property.value *}))"} },
    state      = {__type__="GtkStateType"     ,__default__ = "-1" ,   __gencode__ = {"gtk_icon_source_set_state((GtkIconSource*)({* id *}), (GtkStateType)({* property.value *}))"} },
  },
  parent = nil, 
};

----------------==  GtkIconTheme
----------------==  GtkIdentifier
----------------==  GtkListStore

-- GtkListStore的第一个属性是column_0，然后是column_1，column_2，...，最后以column_count结尾
-- 这里利用了生成属性代码中使用Gtkui.pairs对属性进行了排序的特性
Gtk224.GtkListStore.property["column_0"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"static GType __{*id*}_gtypes__[{* property.value *} + 1] = { //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkListStore.property["^column_%d+$"] = {__type__="GType*", regex = true,
                               __gencode__ = {"    {* Gtkui.GlibBaseTypeToGType(property.value) *}, //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkListStore.property["column_count"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"G_TYPE_INT}",
                                    "gtk_list_store_set_column_types((GtkListStore*){* id *}, (gint){* property.value *}, __{*id*}_gtypes__)"}};

--- 生成GtkListStore的data属性代码
Gtk224.GtkListStore.property["^data_%d+_######$"] = {__type__="gint", regex = true,
                      __gencode__ = {"{ //",
                                    "    GtkTreeIter iter", 
                                    "    gtk_list_store_append ((GtkListStore*){* id *}, &iter)",
                                    "    gtk_list_store_set ((GtkListStore*){* id *}, &iter, //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkListStore.property["^data_%d+_%d+$"] = {__type__="GType*", regex = true,
                      __gencode__ = {"        {* Gtkui.GlibBaseTypeToGType(property.type) *}, {* property.value *}, //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkListStore.property["^data_%d+_======$"] = {__type__="gint", regex = true,
                      __gencode__ = {"    -1)", "}"}};

-- GtkListStore的构建函数
Gtk224.GtkListStore.constructor["new"] = { gencode = "gtk_list_store_new((gint)1, G_TYPE_INT)", params = { type = {}, name = {} } };
--GtkListStore.constructor["new"] = { gencode = "gtk_list_store_new((gint)({* this.n_columns.value *}), {% for idx=1,this.n_columns.value do %}G_TYPE_INT, {% end %} G_TYPE_INT)",
--                                        params = { type = {"gint"}, name = {"n_columns"} } };
Gtk224.GtkListStore.constructor["newv"] = nil;

----------------==  GtkMountOperation
----------------==  GtkObject
----------------==  GtkPageSetup
----------------==  GtkPrintContext
----------------==  GtkPrintOperation
----------------==  GtkPrintSettings
----------------==  GtkRcStyle
----------------==  GtkRecentManager
----------------==  GtkSettings
----------------==  GtkSizeGroup
----- top_widget存储相应根控件，widget_%d存储子控件，所有子控件必须在根控件中
Gtk224.GtkSizeGroup.property["top_widget"] = {__type__="GtkWidget*", __gencode__ = {""}, macro_code = {uisources = "GTK_SIZE_GROUP_LOOKUP"}};
Gtk224.GtkSizeGroup.property["^widget_%d+$"] = {__type__="GtkWidget*", regex = true, ext_depend = true,
                __gencode__ = {"gtk_size_group_add_widget((GtkSizeGroup*){* id *}, (GtkWidget*)GTK_SIZE_GROUP_LOOKUP({* this.top_widget.value *}, {* property.value *}))"}};
Gtk224.GtkSizeGroup.property["widget_count"] = {__type__="guint", __gencode__ = {""}};

----------------==  GtkStatusIcon
Gtk224.GtkStatusIcon.constructor.new_from_file = { gencode = "gtk_status_icon_new_from_file((const gchar*)({* this.file.value *}))",
                                                  params = { type = {"gchar*"}, name = {"file"} } };
Gtk224.GtkStatusIcon.constructor.new_from_gicon = { gencode = "gtk_status_icon_new_from_gicon((GIcon*)({* this.gicon.value *}))",
                                                  params = { type = {"GIcon*"}, name = {"gicon"} } };
Gtk224.GtkStatusIcon.constructor.new_from_stock = { gencode = "gtk_status_icon_new_from_stock((const gchar*)({* this.stock.value *}))",
                                                  params = { type = {"gchar*"}, name = {"stock"} } };

----------------==  GtkStyle
----------------==  GtkTextBuffer
-- 需要patch GtkTextBuffer["constructor"]的new
Gtk224.GtkTextBuffer.constructor["new"] = { gencode = "gtk_text_buffer_new((GtkTextTagTable*)({* this.tag_table.value *}))",
                                        params = { type = {"GtkTextTagTable*"}, name = {"tag_table"} } };
-- 需要patch GtkTextBuffer_property的tag_table
Gtk224.GtkTextBuffer.property["tag_table"]["__default__"] = "NULL"
Gtk224.GtkTextBuffer.property["tag_table"]["__construct__"] = 1
-- 需要patch GtkTextBuffer_property的text
Gtk224.GtkTextBuffer.property["text"]["__gencode__"] = {'gtk_text_buffer_set_text((GtkTextBuffer*){* id *}, (const gchar*){* property.value *}, (gint)-1)'}

----------------==  GtkTextChildAnchor
----------------==  GtkTextLayout
----------------==  GtkTextMark
----------------==  GtkTextTag
Gtk224.PatchGlibProperty(Gtk224.GtkTextTag);

----------------==  GtkTextTagTable
Gtk224.GtkTextTagTable.packing = {
    {
      -- 用于判断是否属于当前组
        group = {}, group_code = {
            { name = {},  gen_code = "gtk_text_tag_table_add((GtkTextTagTable*){* id *}, (GtkTextTag*){* child.id.value *})"},
        },
    },
};

----------------==  GtkTooltip
----------------==  GtkTreeModelFilter
Gtk224.GtkTreeModelFilter.constructor = { 
  -- 名称[- ==> _], 
  new = { gencode = "gtk_tree_model_filter_new((GtkTreeModel*)({* this.child_model.value *}), (GtkTreePath*)({* this.virtual_root.value *}))", 
          params = { type = {"GtkTreeModel*", "GtkTreePath*"}, name = {"child_model", "virtual_root"} } },
};
Gtk224.GtkTreeModelFilter.property.child_model.is_top_widget = true;
Gtk224.GtkTreeModelFilter.property.child_model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeModelFilter.property.virtual_root.__default__ = "NULL";

----------------==  GtkTreeModelSort
Gtk224.GtkTreeModelSort.constructor = { 
  -- 名称[- ==> _], 
  new = { gencode = "gtk_tree_model_sort_new_with_model((GtkTreeModel*)({* this.model.value *}) )", 
          params = { type = {"GtkTreeModel*"}, name = {"model"} } },
};

----------------==  GtkTreeSelection
Gtk224.GtkTreeSelection.constructor = {     -- 名称[- ==> _],
    new = { gencode = "gtk_tree_view_get_selection((GtkTreeView*) {* parent.property.id.value *})", 
            params = { type = {}, name = {} } },
};

----------------==  GtkTreeStore
-- GtkTreeStore的第一个属性是column_0，然后是column_1，column_2，...，最后以column_count结尾
-- 这里利用了生成属性代码中使用Gtkui.pairs对属性进行了排序的特性
Gtk224.GtkTreeStore.property["column_0"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"static GType __{*id*}_gtypes__[{* property.value *} + 1] = { //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkTreeStore.property["^column_%d+$"] = {__type__="GType*", regex = true,
                      __gencode__ = {"    {* Gtkui.GlibBaseTypeToGType(property.value) *}, //"}}; -- 末尾添加双斜杠，用于注释;代码
Gtk224.GtkTreeStore.property["column_count"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"G_TYPE_INT}",
                                     "gtk_tree_store_set_column_types((GtkTreeStore*){* id *}, (gint){* property.value *}, __{*id*}_gtypes__)"}};
-- GtkTreeStore的构建函数
--GtkTreeStore.constructor["new"] = { gencode = "gtk_tree_store_new((gint)({* this.n_columns.value *}),{% for idx=1,this.n_columns.value do %}G_TYPE_INT, {% end %} G_TYPE_INT)", 
--                                       params = { type = {"gint"}, name = {"n_columns"} } };
Gtk224.GtkTreeStore.constructor["new"] = { gencode = "gtk_tree_store_new((gint)(1), G_TYPE_INT)",
                                       params = { type = {}, name = {} } };
Gtk224.GtkTreeStore.constructor["newv"] = nil;

----------------==  GtkUIManager
Gtk224.GtkUIManager.child_property = { 
    -- 属性名称  属性类型 缺省值
    ui        = {__type__="gboolean"},
    parent_id = {__type__="GtkUIManager*"},
};
Gtk224.GtkUIManager.packing = {
    {
        group = {"ui"}, group_code = { { name = {"ui"},  
        gen_code = "gtk_ui_manager_add_ui_from_string((GtkUIManager*){* id *}, (const gchar*){* child.id.value *}, -1, NULL)"},},
    },
    {
        group = {}, group_code = { { name = {},
        gen_code = "gtk_ui_manager_insert_action_group((GtkUIManager*){* id *}, ({* child.class.value *}*){* child.id.value *}, 0)"},},
    },
};
Gtk224.GtkUIManagerChildUI = {
    class = "GtkUIManagerChildUI", 
    constructor = { 
      -- 名称[- ==> _], 
      new = { gencode = "{* this.merge_id.value *}", params = { type = {"gchar*"}, name = {"merge_id"} } },
    },
    signal = { 
      -- 信号名称[- ==> _], 信号返回值, 信号参数列表
    },
    property = { 
      -- 属性名称  属性类型 缺省值 代码生成
      merge_id = {__type__="gchar*", macro_code = {uiheaders = "GTK_UI_MANAGER_CHILD_UI_DEFINE"}},
    },
    parent = nil, 
};

----------------==  GtkWindowGroup
----------------==  GtkAdjustment
----------------==  GtkCellRenderer
Gtk224.GtkCellRenderer.property["__group__"] = {
  {
      -- 用于判断是否属于当前组
      group = {"xalign", "yalign"},
      -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
      group_code = {
          {name = {"xalign", "yalign"}, gen_code = "gtk_cell_renderer_set_alignment((GtkCellRenderer*){* id *}, (gfloat){* this.xalign.value *}, (gfloat){* this.yalign.value *})" },
      }
  },
  {
      -- 用于判断是否属于当前组
      group = {"xpad", "ypad"},
      -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
      group_code = {
          {name = {"xpad", "ypad"}, gen_code = "gtk_cell_renderer_set_padding((GtkCellRenderer*){* id *}, (gint){* this.xpad.value *}, (gint){* this.ypad.value *})" },
      }
  },
  {
    -- 用于判断是否属于当前组
    group = {"height", "width"},
    -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
    group_code = {
        {name = {"height", "width"}, gen_code = "gtk_cell_renderer_set_fixed_size((GtkCellRenderer*){* id *}, (gint){* this.height.value *}, (gint){* this.width.value *})" },
    }
  }
};

function Gtk224.PatchGtkCellRenderers(class)
    local function string_starts(String,Start)
        return string.sub(String,1,string.len(Start))==Start
    end
    local function string_ends(String,End)
        return End=='' or string.sub(String,-string.len(End))==End
    end
    -- 传入类实例，直接进行Patch操作
    if class.property ~= nil then
        for prop_name, property in pairs(class.property) do
            -- 跳过特殊字段
            if (not string_starts(prop_name, "__")) or (not string_ends(prop_name, "__")) then
                local real_prop_name = string.gsub(prop_name, "_", "-")
                -- 如果生成代码为空
                if property.__gencode__ == nil then
                    property.__gencode__ = {"g_object_set(G_OBJECT ({* id *}), \"" .. 
                                              real_prop_name .. "\", (".. property.__type__ .. ")({* property.value *}), NULL)"}
                end
            end
        end
    end
end

Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRenderer);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererAccel);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererCombo);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererPixbuf);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererProgress);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererSpinner);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererText);
Gtk224.PatchGtkCellRenderers(Gtk224.GtkCellRendererToggle);
-- 打完补丁后，这个函数就不需要了
Gtk224.PatchGtkCellRenderers = nil;

----------------==  GtkFileFilter
----------------==  GtkIMContextSimple
----------------==  GtkIMMulticontext
----------------==  GtkItemFactory
----------------==  GtkRecentAction
Gtk224.GtkRecentAction.constructor.new_for_manager = nil;

----------------==  GtkRecentFilter
----------------==  GtkToggleAction
----------------==  GtkTooltips
----------------==  GtkTreeViewColumn
-- ，需要删除new_with_attributes构造函数，分步构造
Gtk224.GtkTreeViewColumn.constructor.new_with_attributes = nil;
-- 添加一个expand的子属性
Gtk224.GtkTreeViewColumn.child_property = {expand = {__type__="gboolean" ,__default__ = "FALSE" }};
Gtk224.GtkTreeViewColumn["packing"] = {
  {
      -- 用于判断是否属于当前组
      group = {}, group_code = { { name = {"expand"},  
          gen_code = "gtk_tree_view_column_pack_start((GtkTreeViewColumn*){* id *}, (GtkCellRenderer*){* child.id.value *}, {* packing.expand.value *})"},
      },
  },
};

----------------==  GtkWidget
Gtk224.GtkWidget.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"width_request", "height_request"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = { {name = {"width_request", "height_request"}, 
            gen_code = "gtk_widget_set_size_request((GtkWidget*){* id *}, {* this.width_request.value *}, {* this.height_request.value *})" },
        }
    },
};

-- 部分子控件，如GtkMessageDialog之类需要parent参数
Gtk224.GtkWidget.property["parent"]["__default__"] = "NULL"

-- GtkWidget的has_default属性对应的代码生成函数
Gtk224.GtkWidget.property["has_default"]["__gencode__"] = {"({* property.value *}) ? gtk_widget_grab_default((GtkWidget*)({* id *})) : (void)0"};
Gtk224.GtkWidget.property["has_focus"]["__gencode__"] = {"({* property.value *}) ? gtk_widget_grab_focus((GtkWidget*)({* id *})) : (void)0"};
Gtk224.GtkWidget.property["is_focus"]["__gencode__"] = {"({* property.value *}) ? gtk_widget_grab_focus((GtkWidget*)({* id *})) : (void)0"};

----------------==  GtkCalendar
Gtk224.PatchGlibProperty(Gtk224.GtkCalendar);

----------------==  GtkCellRendererPixbuf
----------------==  GtkCellRendererProgress
----------------==  GtkCellRendererSpinner
----------------==  GtkCellRendererText
----------------==  GtkCellRendererToggle
----------------==  GtkCellView
-- 这个属性允许为NULL，对应宏名为GET_GDK_COLOR2
Gtk224.GtkCellView.property["background"]["__gencode__"] = {"gtk_cell_view_set_background_color((GtkCellView*)({* id *}, (const GdkColor*)({* property.value *}))"};
Gtk224.GtkCellView.property["background_gdk"]["__gencode__"] = {"gtk_cell_view_set_background_color((GtkCellView*)({* id *}, (const GdkColor*)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkCellView, {"background_set"});

----------------==  GtkContainer
-- GtkContainer的child property属性生成代码
Gtk224.GtkContainer["packing"] = {
    {
        group = {}, group_code = { { name = {}, 
            gen_code = "gtk_container_add((GtkContainer*){* id *}, (GtkWidget*){* child.id.value *})"}},
    },
};

----------------==  GtkDrawingArea
----------------==  GtkEntry
-- GtkEntry的构造函数
Gtk224.GtkEntry.constructor["new_with_max_length"] = {  gencode = "gtk_entry_new_with_max_length((gint)({* this.max_length.value *}))",
													params = { type = {"gint"}, name = {"max_length"} } };
-- GtkEntry的属性
Gtk224.GtkEntry.property["invisible_char"]["__type__"]                      = "gunichar";
Gtk224.GtkEntry.property["xalign"]["__gencode__"]                           = {"gtk_entry_set_alignment((GtkEntry*){* id *}, (gfloat){* property.value *})"};
-- Gtk224.GtkEntry.property["cursor_position"]["__gencode__"]                  = {"gtk_editable_set_position((GtkEditable*){* id *}, (gint){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_activatable"]["__gencode__"]         =  {"gtk_entry_set_icon_activatable((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (gboolean){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_gicon"]["__gencode__"]               =  {"gtk_entry_set_icon_from_gicon((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (GIcon*){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_name"]["__gencode__"]                =  {"gtk_entry_set_icon_from_icon_name((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_pixbuf"]["__gencode__"]              =  {"gtk_entry_set_icon_from_pixbuf((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (GdkPixbuf*){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_sensitive"]["__gencode__"]           =  {"gtk_entry_set_icon_sensitive((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (gboolean){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_stock"]["__gencode__"]               =  {"gtk_entry_set_icon_from_stock((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_tooltip_markup"]["__gencode__"]      =  {"gtk_entry_set_icon_tooltip_markup((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["primary_icon_tooltip_text"]["__gencode__"]        =  {"gtk_entry_set_icon_tooltip_text((GtkEntry*){* id *}, GTK_ENTRY_ICON_PRIMARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_activatable"]["__gencode__"]       =  {"gtk_entry_set_icon_activatable((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (gboolean){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_gicon"]["__gencode__"]             =  {"gtk_entry_set_icon_from_gicon((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (GIcon*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_name"]["__gencode__"]              =  {"gtk_entry_set_icon_from_icon_name((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_pixbuf"]["__gencode__"]            =  {"gtk_entry_set_icon_from_pixbuf((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (GdkPixbuf*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_sensitive"]["__gencode__"]         =  {"gtk_entry_set_icon_sensitive((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (gboolean){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_stock"]["__gencode__"]             =  {"gtk_entry_set_icon_from_stock((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_tooltip_markup"]["__gencode__"]    =  {"gtk_entry_set_icon_tooltip_markup((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (const gchar*){* property.value *})"};
Gtk224.GtkEntry.property["secondary_icon_tooltip_text"]["__gencode__"]      =  {"gtk_entry_set_icon_tooltip_text((GtkEntry*){* id *}, GTK_ENTRY_ICON_SECONDARY, (const gchar*){* property.value *})"};
Gtk224.PatchGlibProperty(Gtk224.GtkEntry, {"caps_lock_warning", "invisible_char_set", "shadow_type", "truncate_multiline"});

----------------==  GtkHSV
----------------==  GtkInvisible
----------------==  GtkMisc

-- GtkMisc的组合属性
Gtk224.GtkMisc.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"xalign", "yalign"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"xalign", "yalign"}, gen_code = "gtk_misc_set_alignment((GtkMisc*){* id *}, (gfloat){* this.xalign.value *}, (gfloat){* this.yalign.value *})" },
        }
    },
    {
        -- 用于判断是否属于当前组
        group = {"xpad", "ypad"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"xpad", "ypad"}, gen_code = "gtk_misc_set_padding((GtkMisc*){* id *}, (gint){* this.xpad.value *}, (gint){* this.ypad.value *})" },
        }
    },
};

----------------==  GtkOldEditable
----------------==  GtkPreview
----------------==  GtkProgress
-- GtkProgress的组合属性
Gtk224.GtkProgress.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"text_xalign", "text_yalign"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"text_xalign", "text_yalign"}, gen_code = {"gtk_progress_set_text_alignment((GtkProgress*){* id *}, (gfloat){* this.text_xalign.value *}, (gfloat){* this.text_yalign.value *})" }},
        }
    },
};

----------------==  GtkRadioAction
Gtk224.GtkRadioAction.property.group.__gencode__ = {"gtk_radio_action_set_group((GtkRadioAction*)({* id *}), (GSList*)gtk_radio_action_get_group({* property.value *}))"};
Gtk224.GtkRadioAction.property.value["__gencode__"] = {"gtk_radio_action_set_current_value((GtkRadioAction*)({* id *}), (gint){* property.value *})"};

----------------==  GtkRange
Gtk224.GtkRange.property.adjustment.__default__ = "NULL";

----------------==  GtkRuler
-- GtkRuler的组合属性
Gtk224.GtkRuler.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"lower", "upper", "position", "max_size"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            { name = {"lower", "upper", "position", "max_size"}, 
              gen_code = "gtk_ruler_set_range((GtkRuler*){* id *}, (gdouble){* this.lower.value *}, (gdouble){* this.upper.value *}, (gdouble){* this.position.value *}, (gdouble){* this.max_size.value *})" },
        }
    },
};

----------------==  GtkSeparator
----------------==  GtkArrow
-- GtkArrow的arrow_type、shadow_type属性属于必选
Gtk224.GtkArrow.property["arrow_type"]["__construct__"] = 1
Gtk224.GtkArrow.property["shadow_type"]["__construct__"] = 1

----------------==  GtkBin
----------------==  GtkBox
-- GtkBox的child property属性生成代码
Gtk224.GtkBox["packing"] = {
    {
      -- 用于判断是否属于当前组，默认pack_type为gtk_box_pack_start，当有pack_type时，通常就是gtk_box_pack_end
      group = {"pack_type"}, group_code = {
          { name = {"expand", "fill", "padding", "pack_type"}, filter_out = {"position"}, 
            gen_code = "gtk_box_pack_end((GtkBox*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"}
      },
    }, 
    {
      -- 全空的名称，则永远都会匹配到
      group = {}, group_code = {
          { name = {"expand", "fill", "padding"}, filter_out = {"position"}, 
            gen_code = "gtk_box_pack_start((GtkBox*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"},
          -- 一般也不需要配置position
          --{ name = {"position"}, 
          --  gen_code = "gtk_box_reorder_child((GtkBox*)gtk_dialog_get_action_area((GtkDialog*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.position.value *})"}
      },
    },
};

----------------==  GtkCList
Gtk224.GtkCList.constructor.new = { gencode = "gtk_clist_new((gint)({* this.n_columns.value *}))", 
                                  params = { type = {"guint"}, name = {"n_columns"} } }
Gtk224.GtkCList.constructor.new_with_titles = nil;
Gtk224.PatchGlibProperty(Gtk224.GtkCList, {"titles_active"});

----------------==  GtkCellRendererAccel
----------------==  GtkCellRendererCombo
----------------==  GtkCellRendererSpin
----------------==  GtkCurve
-- GtkCurve的组合属性
Gtk224.GtkCurve.property["__group__"] = {
  {
	  -- 用于判断是否属于当前组
	  group = {"min_x", "min_y", "max_x", "max_y"},
	  -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
	  group_code = {
		  {name = {"min_x", "min_y", "max_x", "max_y"}, gen_code = "gtk_curve_set_range((GtkCurve*){* id *}, (gfloat){* this.min_x.value *}, (gfloat){* this.max_x.value *}, (gfloat){* this.min_y.value *}, (gfloat){* this.max_y.value *})" },
	  }
  },
};

----------------==  GtkFixed
-- GtkFixed的child property属性生成代码
Gtk224.GtkFixed["packing"] = {
    {
        -- 用于判断是否属于当前组
        -- 正常情况下，都会有x与y的，除非x、y = 0
        group = {}, group_code = { { name = {"x", "y"}, 
            gen_code = "gtk_fixed_put((GtkFixed*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.x.value *}, {* packing.y.value *})"}
        },
    },
};

----------------==  GtkHRuler
----------------==  GtkHSeparator
----------------==  GtkIconView
----------------==  GtkImage
-- GtkImage的构建函数，需要全部重新打patch
Gtk224.GtkImage.constructor = {
    -- 名称[- ==> _]， 
    new                = {  gencode = "gtk_image_new()", 
                            params = { type = {}, name = {} } },
    new_from_animation = {  gencode = "gtk_image_new_from_animation((GdkPixbufAnimation*)({* this.pixbuf_animation.value *}))", 
                            params = { type = {"GdkPixbufAnimation*"}, name = {"pixbuf_animation"} } },
    new_from_file_utf8 = { gencode = "gtk_image_new_from_file_utf8((GdkPixbufAnimation*)({* this.file.value *}))", 
                            params = { type = {"gchar*"}, name = {"file"} } },
    new_from_gicon     = { gencode = "gtk_image_new_from_gicon((GIcon*)({* this.gicon.value *}), (GtkIconSize)({* this.icon_size.value *}))",
                            params = { type = {"GIcon*", "gint"}, name = {"gicon", "icon_size"} } },
    new_from_icon_name = { gencode = "gtk_image_new_from_gicon((GIcon*)({* this.icon_name.value *}), (GtkIconSize)({* this.icon_size.value *}))", 
                            params = { type = {"const gchar*", "gint"}, name = {"icon_name", "icon_size"} } },
    new_from_icon_set  = { gencode = "gtk_image_new_from_icon_set((GtkIconSet*)({* this.icon_set.value *}), (GtkIconSize)({* this.icon_size.value *}))", 
                            params = { type = {"GtkIconSet*", "gint"}, name = {"icon_set", "icon_size"} } },
    new_from_image     = { gencode = "gtk_image_new_from_image((GdkImage*)({* this.image.value *}), (GdkBitmap*)({* this.mask.value *}))", 
                            params = { type = {"GdkImage*", "GdkBitmap*"}, name = {"image", "mask"} } },
    new_from_stock     = { gencode = "gtk_image_new_from_stock((const gchar*)({* this.stock.value *}), (GtkIconSize)({* this.icon_size.value *}))", 
                            params = { type = {"gchar*", "gint"}, name = {"stock", "icon_size"} } },
    new_from_pixbuf    = { gencode = "gtk_image_new_from_pixbuf((GdkPixbuf*)GET_GDK_PIX_BUF({* this.pixbuf.value *}))", 
                            params = { type = {"GdkPixbuf*"}, name = {"pixbuf"} } },
};

-- GtkImage的属性设置接口
Gtk224.GtkImage.property["gicon"]["__need_more__"] = {"icon_size"};       -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["icon_name"]["__need_more__"] = {"icon_size"};   -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["icon_set"]["__need_more__"] = {"icon_size"};    -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["stock"]["__need_more__"] = {"icon_size"};       -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["gicon"]["__gencode__"]     = {"gtk_image_set_from_gicon((GtkImage*)({* id *}), (GIcon*)({* property.value *}), (GtkIconSize)({* this.icon_size.value *}))"};
Gtk224.GtkImage.property["icon_name"]["__gencode__"] = {"gtk_image_set_from_icon_name((GtkImage*)({* id *}), (const gchar*)({* property.value *}), (GtkIconSize)({* this.icon_size.value *}))"};
Gtk224.GtkImage.property["icon_set"]["__gencode__"]  = {"gtk_image_set_from_icon_set((GtkImage*)({* id *}), (GtkIconSet*)({* property.value *}), (GtkIconSize)({* this.icon_size.value *}))"};
Gtk224.GtkImage.property["stock"]["__gencode__"]     = {"gtk_image_set_from_stock((GtkImage*){* id *}, (gchar*){* property.value *}, (GtkIconSize){* this.icon_size.value *})"};

Gtk224.GtkImage.property["image"]["__need_more__"] = {"mask"}; -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["pixmap"]["__need_more__"] = {"mask"}; -- 需要额外的属性，如果不存在，则应该去取得默认值
Gtk224.GtkImage.property["image"]["__gencode__"]     = {"gtk_image_set_from_image((GtkImage*)({* id *}), (GdkImage*)({* property.value *}), (GdkBitmap*)({* this.mask.value *}))"};
Gtk224.GtkImage.property["pixmap"]["__gencode__"]    = {"gtk_image_set_from_pixmap((GtkImage*)({* id *}), (GdkPixmap*)({* property.value *}), (GdkBitmap*)({* this.mask.value *}))"};

Gtk224.GtkImage.property["pixbuf_animation"]["__gencode__"]    = {"gtk_image_set_from_animation((GtkImage*)({* id *}), (GdkPixbufAnimation*)({* property.value *}))"};

----------------==  GtkLabel
-- GtkLabel的构建函数
Gtk224.GtkLabel.constructor["new"]                = { gencode = "gtk_label_new((const gchar*)({* this.label.value *}))",
                                                    params = { type = {"gchar*"}, name = {"label"} } };
Gtk224.GtkLabel.constructor["new_with_mnemonic"]  = { gencode = "gtk_label_new_with_mnemonic((const gchar*)({* this.label.value *}))",
                                                    params = { type = {"gchar*", "gboolean"}, name = {"label", "use_underline"} } };

Gtk224.GtkLabel.property.wrap["__gencode__"] = {"gtk_label_set_line_wrap((GtkLabel*)({* id *}), (gboolean)({* property.value *}))"}
Gtk224.GtkLabel.property.wrap_mode["__gencode__"] = {"gtk_label_set_line_wrap_mode((GtkLabel*)({* id *}), (PangoWrapMode)({* property.value *}))"}

-- GtkLabel的第一个Pango属性是pango_attr_0_start，然后是pango_attr_XXX 最后以pango_attr_z_end结尾
-- 这里利用了生成属性代码中使用Gtkui.pairs对属性进行了排序的特性
Gtk224.GtkLabel.property["pango_attr_0_start"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"{ //",
                                     "    PangoAttribute* _{* id *}_pango_attr = NULL",
                                     "    PangoAttrList*  _{* id *}_pango_attr_list = pango_attr_list_new()"}
};
Gtk224.GtkLabel.property["^pango_attr_[%-%l]+_1_start$"] = {__type__="guint", __default__ = "0", regex = true,
                      __gencode__ = {"    _{* id *}_pango_attr->start_index = {* property.value *}"}
};
Gtk224.GtkLabel.property["^pango_attr_[%-%l]+_2_end$"] = {__type__="guint", __default__ = "4294967295", regex = true,
                      __gencode__ = {"    _{* id *}_pango_attr->end_index = {* property.value *}"}
};
Gtk224.GtkLabel.property["^pango_attr_[%-%l]+_3_value$"] = {__type__="guint", regex = true,
                      __gencode__ = {"    pango_attr_list_insert (_{* id *}_pango_attr_list, _{* id *}_pango_attr)"}
};

Gtk224.GtkLabel.property["pango_attr_language_0_value"] = {__type__="gchar*",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_language_new((PangoLanguage)(pango_language_from_string({* property.value *})))",}
};
Gtk224.GtkLabel.property["pango_attr_style_0_value"] = {__type__="PangoStyle",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_style_new((PangoStyle)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_weight_0_value"] = {__type__="PangoWeight",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_weight_new((PangoWeight)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_variant_0_value"] = {__type__="PangoVariant",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_variant_new((PangoVariant)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_stretch_0_value"] = {__type__="PangoStretch",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_stretch_new((PangoStretch)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_underline_0_value"] = {__type__="gboolean",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_underline_new((PangoUnderline)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_strikethrough_0_value"] = {__type__="gboolean",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_strikethrough_new((gboolean)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_gravity_0_value"] = {__type__="PangoGravity",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_gravity_new((PangoGravity)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_gravity-hint_0_value"] = {__type__="PangoGravityHint",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_gravity_hint_new((PangoGravityHint)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_family_0_value"] = {__type__="gchar*",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_family_new((const gchar*)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_size_0_value"] = {__type__="gint",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_size_new({* property.value *})"}
};
Gtk224.GtkLabel.property["pango_attr_absolute-size_0_value"] = {__type__="gint",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_size_new_absolute({* property.value *})"}
};
Gtk224.GtkLabel.property["pango_attr_font_desc_0_value"] = {__type__="gchar*",
                      __gencode__ = {"    { //","        PangoFontDesc* _font_desc = pango_font_description_from_string({* property.value *})",
                                     "        _{* id *}_pango_attr = pango_attr_font_desc_new(_font_desc)",
                                     "        pango_font_description_free(_font_desc)","    } //"}
};
Gtk224.GtkLabel.property["pango_attr_foreground_0_value"] = {__type__="gchar*", macro_code = {uisources = "GDK_COLOR"},
                      __gencode__ = {"    { // ","        const GdkColor* color = GET_GDK_COLOR({* property.value *})",
                                     "        _{* id *}_pango_attr = pango_attr_foreground_new(color->red, color->green, color->blue)","    } //"}
};
Gtk224.GtkLabel.property["pango_attr_background_0_value"] = {__type__="gchar*", macro_code = {uisources = "GDK_COLOR"},
                      __gencode__ = {"    { // ", "        const GdkColor* color = GET_GDK_COLOR({* property.value *})",
                                     "        _{* id *}_pango_attr = pango_attr_background_new(color->red, color->green, color->blue)", "    } //"}
};
Gtk224.GtkLabel.property["pango_attr_underline-color_0_value"] = {__type__="gchar*", macro_code = {uisources = "GDK_COLOR"},
                      __gencode__ = {"    { // ", "        const GdkColor* color = GET_GDK_COLOR({* property.value *})",
                                     "        _{* id *}_pango_attr = pango_attr_underline_color_new(color->red, color->green, color->blue)", "    } //"}
};
Gtk224.GtkLabel.property["pango_attr_strikethrough-color_0_value"] = {__type__="gchar*", macro_code = {uisources = "GDK_COLOR"},
                      __gencode__ = {"    { // ", "        const GdkColor* color = GET_GDK_COLOR({* property.value *})",
                                     "        _{* id *}_pango_attr = pango_attr_strikethrough_color_new(color->red, color->green, color->blue)", "    } //"}
};
Gtk224.GtkLabel.property["pango_attr_scale_0_value"] = {__type__="gdouble",
                      __gencode__ = {"    _{* id *}_pango_attr = pango_attr_scale_new((gdouble)({* property.value *}))"}
};
Gtk224.GtkLabel.property["pango_attr_z_end"] = {__type__="gint" ,__default__ = "0",
                      __gencode__ = {"    gtk_label_set_attributes((GtkLabel*)({* id *}), (PangoAttrList*)(_{* id *}_pango_attr_list))",
                                     "    pango_attr_list_unref(_{* id *}_pango_attr_list)", "} //"}
};

----------------==  GtkLayout
-- GtkLayout的child property属性生成代码
Gtk224.GtkLayout["packing"] = {
    {
        -- 用于判断是否属于当前组
        -- 正常情况下，都会有x与y的，除非x、y = 0
        group = {},  group_code = { {name = {"x", "y"}, 
            gen_code = "gtk_layout_put((GtkLayout*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.x.value *}, {* packing.y.value *})"}},
    },
};

-- GtkLayout的property属性生成代码
Gtk224.GtkLayout.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"height", "width"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"height", "width"}, gen_code = "gtk_layout_set_size((GtkWidget*){* id *}, {* this.width.value *}, {* this.height.value *})" },
        }
    },
};

----------------==  GtkList
---- 如果是Gtk.Combo中的entry，应该直接访问变量方式取得
Gtk224.GtkList.property["is_inter_child_in_combo"] = {__type__="gboolean" ,__default__ = "TRUE", __construct__= 1 };
Gtk224.GtkList.constructor.new_from_inter_child_in_combo = { gencode = "((GtkCombo*)({* parent.property.id.value *})->list", 
                                                     params = { type = {"gboolean"}, name = {"is_inter_child_in_combo"} } };

----------------==  GtkMenuShell
Gtk224.GtkMenuShell["packing"] = {
    {
        -- 用于判断是否属于当前组
        group = {},  group_code = { {name = {}, 
            gen_code = "gtk_menu_shell_append((GtkMenuShell*){* id *}, (GtkWidget*){* child.id.value *})"}},
    },
};

----------------==  GtkNotebook
-- GtkNotebook的child property属性生成代码，根据child property属性来判断调用哪一句话生成代码
Gtk224.GtkNotebook["packing"] = {
    {
        -- 用于判断是否属于当前组
        group = {}, group_code = { { name = {}, can_skip = true, gen_code = "" , 
            filter_out = {"detachable", "menu_label", "position", "reorderable", "tab_expand", "tab_fill", "tab_pack", "tab_label"}}},
    },
};
Gtk224.GtkNotebook.property.enable_popup.__gencode__ = {"g_object_set((GObject*){* id *}, \"enable-popup\", (gboolean){* property.value *}, NULL)"};
Gtk224.GtkNotebook.property.homogeneous.__gencode__ = {"gtk_notebook_set_homogeneous_tabs((GtkNotebook*)({* id *}), (gboolean)({* property.value *}))";};
  
---------------------  GtkNotebookLabel，包装用于处理GtkNotebook的处理
Gtk224.GtkNotebookLabel = {
    class = "GtkNotebookLabel",
    -- 直接套用GtkLabel的构造函数
    constructor = Gtk224.GtkLabel.constructor,
    signal = { 
        -- 信号名称[- ==> _]， 信号返回值, 信号参数列表
    },
    property = {
    },
    -- 直接拷贝GtkNotebook的子属性
    child_property = Gtk224.table_copy_table_in_patch(Gtk224.GtkNotebook.child_property),
    packing = {
        { group = {"parent_id"}, group_code = { { name = {"parent_id"},                     
              gen_code = "gtk_notebook_append_page((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, (GtkWidget*){* id *})"}}
        },
        { group = {"detachable"}, group_code = { { name = {"detachable"}, 
              gen_code = "gtk_notebook_set_tab_detachable((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.detachable.value *})"}}
        },
        { group = {"menu_label"}, group_code = { { name = {"menu_label"}, 
            gen_code = "gtk_notebook_set_menu_label_text((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.menu_label.value *})"}}
        },
        { group = {"position"}, group_code = { { name = {"position"}, can_skip = true, gen_code = ""}}
        },
        { group = {"reorderable"}, group_code = { { name = {"reorderable"}, 
            gen_code = "gtk_notebook_set_tab_reorderable((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.reorderable.value *})"}}
        },
        { group = {}, group_code = { { name = {"tab_expand", "tab_fill", "tab_pack"}, can_skip = true,
            gen_code = "gtk_notebook_set_tab_label_packing((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.tab_expand.value *}, {* packing.tab_fill.value *}, {* packing.tab_pack.value *})"}}
        },
        { group = {"tab_label"}, group_code = { { name = {"tab_label"}, 
            gen_code = "gtk_notebook_set_tab_label_text((GtkNotebook*){* packing.parent_id.value *}, (GtkWidget*){* child.id.value *}, (const gchar *)({* packing.tab_label.value *})"}}
        },
    },
    parent = Gtk224.GtkLabel,
};

-- 添加一个子属性
Gtk224.GtkNotebookLabel.child_property.parent_id = {__type__="GtkNotebook*", __default__ = "NULL", macro_code = {uiheaders = "NOTEBOOK_LABEL_DEFINE"}};

----------------==  GtkPaned
-- GtkPaned的child property属性生成代码，根据child property属性来判断调用哪一句话生成代码
Gtk224.GtkPaned["packing"] = {
    {
        -- 用于判断是否属于当前组
        group = {}, group_code = { { name = {"resize", "shrink"}, 
            gen_code = "(*((NULL == gtk_paned_get_child1((GtkPaned*){* id *})) ? &gtk_paned_pack1: &gtk_paned_pack2))((GtkPaned*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.resize.value *}, {* packing.shrink.value *})"}
        },
    },
};
Gtk224.PatchGlibProperty(Gtk224.GtkPaned, {"position_set"});

----------------==  GtkPixmap
----------------==  GtkProgressBar
Gtk224.PatchGlibProperty(Gtk224.GtkProgressBar, {"adjustment"});

----------------==  GtkScale
----------------==  GtkScrollbar
----------------==  GtkSocket
----------------==  GtkSpinButton
Gtk224.GtkSpinButton.constructor.new2 = {
    gencode = "gtk_spin_button_new((GtkAdjustment*)(NULL), (gdouble)(0), (guint)(0))", 
    params = { type = {}, name = {} }
};

Gtk224.GtkSpinButton.constructor.new_with_range = { 
    gencode = "gtk_spin_button_new_with_range((gdouble)gtk_adjustment_get_lower({* this.adjustment.value *}), (gdouble)gtk_adjustment_get_upper({* this.adjustment.value *}), (gdouble)gtk_adjustment_get_step_increment({* this.adjustment.value *}))", 
    params = { type = {"GtkAdjustment*"}, name = {"adjustment"}}
};

-- 默认adjustment属性为NULL
Gtk224.GtkSpinButton.property["adjustment"]["__default__"] = "NULL";

Gtk224.PatchGlibProperty(Gtk224.GtkSpinButton, {"climb_rate"});

----------------==  GtkSpinner
Gtk224.PatchGlibProperty(Gtk224.GtkSpinner, {"active"});
--Gtk224.GtkSpinner.property.active.__gencode__ = { "g_object_set((GObject*)({* id *}), \"active\", (gboolean)({* property.value *}), NULL)" };

----------------==  GtkTable
-- 需要patch GtkTable["constructor"]的new
Gtk224.GtkTable.constructor["new"] = { gencode = "gtk_table_new((guint)({* this.n_rows.value *}), (guint)({* this.n_columns.value *}), (gboolean)({* this.homogeneous.value *}))",
                                   params = { type = {"guint", "guint", "gboolean"}, name = {"n_rows", "n_columns", "homogeneous"} } };

-- 需要patch GtkTable_property的column_spacing
Gtk224.GtkTable.property["column_spacing"]["__gencode__"] = {'gtk_table_set_col_spacings((GtkTable*){* id *}, (guint){* property.value *})'}
Gtk224.GtkTable.property["row_spacing"]["__gencode__"]    = {'gtk_table_set_row_spacings((GtkTable*){* id *}, (guint){* property.value *})'}

Gtk224.GtkTable.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"n_rows", "n_columns"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"n_rows", "n_columns"}, gen_code = "gtk_table_resize((GtkTable*){* id *}, {* this.n_rows.value *}, {* this.n_columns.value *})" },
        }
    },
};

-- GtkTable的child property属性生成代码
Gtk224.GtkTable["packing"] = {
    {
        -- 用于判断是否属于当前组
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group = {}, group_code = {{ name = {"left_attach", "right_attach", "top_attach", "bottom_attach", "x_options", "y_options", "x_padding", "y_padding"}, 
            gen_code = "gtk_table_attach((GtkTable*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.left_attach.value *}, {* packing.right_attach.value *}, {* packing.top_attach.value *}, {* packing.bottom_attach.value *}, (GtkAttachOptions)({* packing.x_options.value *}), (GtkAttachOptions)({* packing.y_options.value *}), {* packing.x_padding.value *}, {* packing.y_padding.value *})"},
        }
    },
};

----------------==  GtkTextView
----------------==  GtkToolItemGroup
Gtk224.GtkToolItemGroup["packing"] = {
    {
        group = {"position"}, group_code = { { name = {"position"},  
            gen_code = "gtk_tool_item_group_insert((GtkToolItemGroup*){* id *}, (GtkToolItem*){* child.id.value *}, (gint)({* packing.position.value *}))"}},
    },
    {
        group = {"expand"}, group_code = { { name = {"expand"},
            gen_code = "gtk_container_child_set_property((GtkContainer*){* id *}, (GtkWidget*){* child.id.value *}, \"expand\", (gint)({* packing.expand.value *}), NULL)"}},
    },
    {
        group = {"fill"}, group_code = { { name = {"fill"},
            gen_code = "gtk_container_child_set_property((GtkContainer*){* id *}, (GtkWidget*){* child.id.value *}, \"fill\", (gint)({* packing.fill.value *}), NULL)"}},
    },
    {
        group = {"homogeneous"}, group_code = { { name = {"homogeneous"},
            gen_code = "gtk_container_child_set_property((GtkContainer*){* id *}, (GtkWidget*){* child.id.value *}, \"homogeneous\", (gint)({* packing.homogeneous.value *}), NULL)"}},
    },
    {
        group = {"new_row"}, group_code = { { name = {"new_row"},
            gen_code = "gtk_container_child_set_property((GtkContainer*){* id *}, (GtkWidget*){* child.id.value *}, \"new-row\", (gint)({* packing.new_row.value *}), NULL)"}},
    },
};

----------------==  GtkToolPalette
Gtk224.GtkToolPalette.property.toolbar_style.__gencode__ = {"gtk_tool_palette_set_style((GtkToolPalette*)({* id *}), (GtkToolbarStyle)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkToolPalette, {"icon_size_set"});
-- 拷贝Gtk224.GtkContainer的packing，然后再插入多条记录
Gtk224.GtkToolPalette.packing = Gtk224.copy_and_insert_more(Gtk224.GtkToolPalette.parent.packing,
    {
        group = {"exclusive"}, group_code = { { name = {"exclusive"}, 
            gen_code = "gtk_tool_palette_set_exclusive((GtkToolPalette*){* id *}, (GtkToolItemGroup*){* child.id.value *}, (gboolean)({* packing.exclusive.value *}))"}},
    },
    {
        group = {"expand"}, group_code = { { name = {"expand"}, 
            gen_code = "gtk_tool_palette_set_expand((GtkToolPalette*){* id *}, (GtkToolItemGroup*){* child.id.value *}, (gboolean)({* packing.expand.value *}))"}},
    }
);

----------------==  GtkToolbar
Gtk224.GtkToolbar.property.toolbar_style.__gencode__ = {"gtk_toolbar_set_style((GtkToolbar*)({* id *}), (GtkToolbarStyle)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkToolbar, {"icon_size_set"});
Gtk224.GtkToolbar.packing = {
    {
        group = {}, group_code = { { name = {}, 
            gen_code = "gtk_toolbar_insert((GtkToolbar*){* id *}, (GtkToolItem*){* child.id.value *}, -1)"}},
    },
    {
        group = {"homogeneous"}, group_code = { { name = {"homogeneous"}, 
            gen_code = "gtk_tool_item_set_homogeneous((GtkToolItem*){* id *}, (gboolean)({* packing.homogeneous.value *}))"}},
    },
    {
        group = {"expand"}, group_code = { { name = {"expand"}, 
            gen_code = "gtk_tool_item_set_expand((GtkToolItem*){* id *}, (gboolean)({* packing.expand.value *}))"}},
    },
};

----------------==  GtkTreeView
Gtk224.GtkTreeView.property["enable_grid_lines"]["__gencode__"] = {"gtk_tree_view_set_grid_lines((GtkTreeView*)({* id *}), (GtkTreeViewGridLines)({* property.value *}))"};
-- 添加一个子属性
Gtk224.GtkTreeView.child_property = { ["internal_child"] = {__type__="gchar*"   ,__default__ = "NULL"}};
Gtk224.GtkTreeView["packing"] = {
    {
        -- 如果是内部GtkTreeSelection，则不需要关联代码
        group = {"internal_child"}, group_code = { { name = {"internal_child"},  can_skip = true, gen_code = ""}},
    },
    {
        group = {}, group_code = { { name = {},  
            gen_code = "gtk_tree_view_append_column((GtkTreeView*){* id *}, (GtkTreeViewColumn*){* child.id.value *})"}},
    },
};

----------------==  GtkVRuler
----------------==  GtkVSeparator
----------------==  GtkAccelLabel
Gtk224.GtkAccelLabel.constructor.new = { gencode = "gtk_accel_label_new((const gchar*)({* this.label.value *}))", 
                                        params = { type = {"gchar*"}, name = {"label"} } };

----------------==  GtkAlignment
-- GtkAlignment的组合属性
Gtk224.PatchGlibProperty(Gtk224.GtkAlignment, {"xalign", "yalign", "xscale", "yscale"});
Gtk224.GtkAlignment.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"bottom_padding", "left_padding", "right_padding", "top_padding"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"bottom_padding", "left_padding", "right_padding", "top_padding"}, gen_code = "gtk_alignment_set_padding((GtkAlignment*){* id *}, (guint){* this.top_padding.value *}, (guint){* this.bottom_padding.value *}, (guint){* this.left_padding.value *}, (guint){* this.right_padding.value *})" },
        }
    },
};

----------------==  GtkButton
--- 添加完善GtkButton的三个属性的设置代码，用于某些特殊的internal-child场景
Gtk224.GtkButton.property.label.__gencode__ = {"gtk_button_set_label((GtkButton*)({* id *}), (const gchar*)({* property.value *}))"};
Gtk224.GtkButton.property.use_stock.__gencode__ = {"gtk_button_set_use_stock((GtkButton*)({* id *}), (gboolean)({* property.value *}))"};
Gtk224.GtkButton.property.use_underline.__gencode__ = {"gtk_button_set_use_underline((GtkButton*)({* id *}), (gboolean)({* property.value *}))"};
-- GtkButton的构建函数new_from_stock需要patch
Gtk224.GtkButton.constructor["new_from_stock"] = {  gencode = "gtk_button_new_from_stock((const gchar*)({* this.label.value *}))",
                                                params = { type = {"gchar*", "gboolean"}, name = {"label", "use_stock"} } };

-- GtkButton的构建函数new_with_mnemonic需要patch
Gtk224.GtkButton.constructor["new_with_mnemonic"] = {  gencode = "gtk_button_new_with_mnemonic((const gchar*)({* this.label.value *}))",
                                                params = { type = {"gchar*", "gboolean"}, name = {"label", "use_underline"} } };

-- GtkButton的组合属性
Gtk224.GtkButton.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group = {"xalign", "yalign"},
        group_code = {
            {name = {"xalign", "yalign"}, gen_code = "gtk_button_set_alignment((GtkButton*){* id *}, (gfloat){* this.xalign.value *}, (gfloat){* this.yalign.value *})" },
        }
    },
};

----------------==  GtkButtonBox
-- GtkButtonBox的layout_style属性对应的代码生成函数
Gtk224.GtkButtonBox.property["layout_style"]["__gencode__"] = {"gtk_button_box_set_layout((GtkButtonBox*)({* id *}), (GtkButtonBoxStyle)({* property.value *}))"};
-- 影子拷贝，然后再插入一项
Gtk224.GtkButtonBox.packing = Gtk224.copy_and_insert_more(Gtk224.GtkButtonBox.parent.packing,
    {
        group = {"secondary"}, group_code = { { name = {"secondary"}, 
            gen_code = "gtk_button_box_set_child_secondary((GtkButtonBox*){* id *}, (GtkWidget*){* child.id.value *}, (gboolean)({* packing.secondary.value *}))"}}
    }
);

----------------==  GtkCTree
Gtk224.GtkCTree.constructor.new = { gencode = "gtk_ctree_new((gint)({* this.n_columns.value *}), (gint)({* this.tree_column.value *}))", 
          params = { type = {"guint", "gint"}, 
                     name = {"n_columns", "tree_column"} } };
Gtk224.GtkCTree.constructor.new_with_titles = nil;

----------------==  GtkComboBox
Gtk224.GtkComboBox.child_property = { ["internal_child"] = {__type__="gchar*"   ,__default__ = "NULL"}};
--- 增加一个辅助类
Gtk224.GtkComboBoxChildEntry = {
  class = "GtkComboBoxChildEntry", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_bin_get_child(GTK_BIN({* parent.property.id.value *}))", 
            params = { type = {"gboolean"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gboolean", macro_code = {uiheaders = "COMBOBOX_CHILD_ENTRY_DEFINE"}},
  },
  parent = Gtk224.GtkEntry,
};
-- GtkComboBox的构建函数new_text/new_with_entry/new_with_model_and_entry需要patch
Gtk224.GtkComboBox.packing = {
    {
        -- 如果是内部GtkEntry，则不需要关联代码
        group = {"internal_child"}, group_code = { { name = {"internal_child"}, can_skip = true, gen_code = ""}},
    },
};

Gtk224.GtkComboBox.constructor.new_text = nil;
Gtk224.GtkComboBox.constructor.new_with_model.params = { type = {"GtkTreeModel*"}, name = {"model"} };
Gtk224.GtkComboBox.constructor.new_with_entry.params = { type = {"gboolean"}, name = {"has_entry"} };
Gtk224.GtkComboBox.constructor.new_with_model_and_entry.params = { type = {"GtkTreeModel*", "gboolean"}, name = {"model", "has_entry"} };

Gtk224.GtkComboBox.property.tearoff_title.__gencode__ = {"gtk_combo_box_set_title((GtkComboBox*)({* id *}), (const gchar*)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkComboBox, {"has_frame"});

----------------==  GtkEventBox
----------------==  GtkExpander
Gtk224.GtkExpander.constructor.new_with_mnemonic.params = { type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} }
Gtk224.GtkExpander.property.expanded.__gencode__ = {"gtk_expander_set_expanded((GtkExpander*)({* id *}), (gboolean)({* property.value *}))"};
Gtk224.GtkExpander.property.use_markup.__gencode__ = {"gtk_expander_set_use_markup((GtkExpander*)({* id *}), (gboolean)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkExpander, {"label_fill"});

----------------==  GtkFrame
Gtk224.GtkFrame.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"label_xalign", "label_yalign"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"label_xalign", "label_yalign"}, gen_code = "gtk_frame_set_label_align((GtkFrame*){* id *}, (gfloat){* this.label_xalign.value *}, (gfloat){* this.label_yalign.value *})" },
        }
    },
};
Gtk224.GtkFrame.property.shadow.__gencode__ = Gtk224.GtkFrame.property.shadow_type.__gencode__;

----------------==  GtkHBox
----------------==  GtkHPaned
----------------==  GtkHScale
Gtk224.GtkHScale.constructor.new_with_range = nil

----------------==  GtkHScrollbar
----------------==  GtkHandleBox
Gtk224.GtkHandleBox.property.shadow.__gencode__ = Gtk224.GtkHandleBox.property.shadow_type.__gencode__;
Gtk224.PatchGlibProperty(Gtk224.GtkHandleBox, {"snap_edge_set"});

----------------==  GtkItem
----------------==  GtkMenu
Gtk224.GtkMenu.packing = {
    {
        -- 如果有如下四个参数的一个，则应该使用gtk_menu_attach关联
        group = {"bottom_attach", "left_attach", "right_attach", "top_attach"}, group_or_check=true, group_code = { { name = {"bottom_attach", "left_attach", "right_attach", "top_attach"}, 
            gen_code = "gtk_menu_attach((GtkMenu*){* id *}, (GtkWidget*)({* child.id.value *}), (gboolean)({* packing.left_attach.value *}), (gboolean)({* packing.right_attach.value *}), (gboolean)({* packing.top_attach.value *}), (gboolean)({* packing.bottom_attach.value *}))"},
        },
    }
    -- 否则会调用到GtkMenuShell的gtk_menu_shell_append
};
Gtk224.GtkMenu.property.tearoff_title.__gencode__ = {"gtk_menu_set_title((GtkMenu*)({* id *}), (const gchar*)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkMenu, {"attach_widget"});

----------------==  GtkMenuBar
----------------==  GtkScrolledWindow
Gtk224.GtkScrolledWindow.property.hadjustment.__default__ = "NULL";
Gtk224.GtkScrolledWindow.property.vadjustment.__default__ = "NULL";
Gtk224.GtkScrolledWindow.property.window_placement.__gencode__ = {"gtk_scrolled_window_set_placement((GtkScrolledWindow*){* id *}, (GtkCornerType)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkScrolledWindow, {"window_placement_set"});
Gtk224.GtkScrolledWindow.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"hscrollbar_policy", "vscrollbar_policy"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = {
            {name = {"hscrollbar_policy", "vscrollbar_policy"}, gen_code = "gtk_scrolled_window_set_policy((GtkScrolledWindow*){* id *}, (GtkPolicyType){* this.hscrollbar_policy.value *}, (GtkPolicyType){* this.vscrollbar_policy.value *})" },
        }
    },
};

----------------==  GtkTipsQuery
Gtk224.GtkTipsQuery.property["__group__"] = {
  {
      -- 用于判断是否属于当前组
      group = {"label_inactive", "label_no_tip"},
      -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
      group_code = {
          {name = {"label_inactive", "label_no_tip"}, gen_code = "gtk_tips_query_set_labels((GtkTipsQuery*){* id *}, (const gchar*){* this.label_inactive.value *}, (const gchar*){* this.label_no_tip.value *})" },
      }
  },
};
Gtk224.PatchGlibProperty(Gtk224.GtkTipsQuery, {"emit_always"});

----------------==  GtkToolItem
----------------==  GtkVBox
----------------==  GtkVPaned
----------------==  GtkVScale
Gtk224.GtkVScale.constructor.new_with_range = nil

----------------==  GtkVScrollbar
----------------==  GtkViewport
Gtk224.GtkViewport.property.hadjustment.__default__ = "NULL";
Gtk224.GtkViewport.property.vadjustment.__default__ = "NULL";

----------------==  GtkWindow
Gtk224.GtkWindow.property["^z_accel_group_%d+$"] = {__type__="GtkAccelGroup*", regex = true, 
                is_top_widget = true, ext_depend = true, macro_code = {uisources = "TOP_WIDGET"},
                __gencode__ = {"gtk_window_add_accel_group((GtkWindow*){* id *}, (GtkAccelGroup*)({* property.value *}))"}};
Gtk224.GtkWindow.property.window_position.__gencode__ = {"gtk_window_set_position((GtkWindow*)({* id *}), (GtkWindowPosition)({* property.value *}))"};
Gtk224.GtkWindow.property["__group__"] = {
    {
        -- 用于判断是否属于当前组
        group = {"allow_grow", "allow_shrink"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = { {name = {"allow_grow", "allow_shrink"}, 
            gen_code = "gtk_window_set_policy((GtkWindow*){* id *}, (gboolean){* this.allow_shrink.value *}, (gboolean){* this.allow_grow.value *}, TRUE)" },
        }
    },
    {
        -- 用于判断是否属于当前组
        group = {"default_height", "default_width"},
        -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
        group_code = { {name = {"default_height", "default_width"}, 
            gen_code = "gtk_window_set_default_size((GtkWindow*){* id *}, (gint){* this.default_width.value *}, (gint){* this.default_height.value *})" },
        }
    },
};

----------------==  GtkAspectFrame
Gtk224.GtkAspectFrame.property["__group__"] = {
  {
      -- 用于判断是否属于当前组
      group = {"xalign", "yalign", "ratio", "obey_child"},
      -- 当前组内，用于生成代码的允许多种组合，匹配顺序为从上往下
      group_code = { {name = {"xalign", "yalign", "ratio", "obey_child"}, 
          gen_code = "gtk_aspect_frame_set((GtkAspectFrame*){* id *}, (gfloat){* this.xalign.value *}, (gfloat){* this.yalign.value *}, (gfloat){* this.ratio.value *}, (gboolean){* this.obey_child.value *})" },
      }
  },
};

----------------==  GtkAssistant
-- GtkAssistant的child property属性生成代码
Gtk224.GtkAssistant["packing"] = {
    {
        group = {}, group_code = { { name = {}, 				                          
            gen_code = "gtk_assistant_append_page((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *})"}}
    },
    {
        group = {"complete"}, group_code = { { name = {"complete"},
            gen_code = "gtk_assistant_set_page_complete((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *}, (gboolean){* packing.complete.value *})"}}
    },
    {
        group = {"header_image"}, group_code = { { name = {"header_image"},
            gen_code = "gtk_assistant_set_page_header_image((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *}, (GdkPixbuf*){* packing.header_image.value *})"}}
    },
    {
        group = {"page_type"}, group_code = { { name = {"page_type"},
            gen_code = "gtk_assistant_set_page_type((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *}, (GtkAssistantPageType){* packing.page_type.value *})"}}
    },
    {
        group = {"sidebar_image"}, group_code = { { name = {"sidebar_image"},
            gen_code = "gtk_assistant_set_page_side_image((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *}, (GdkPixbuf*){* packing.sidebar_image.value *})"}}
    },
    {
        group = {"title"}, group_code = { { name = {"title"},
            gen_code = "gtk_assistant_set_page_title((GtkAssistant*){* id *}, (GtkWidget*){* child.id.value *}, (const gchar*){* packing.title.value *})"}}
    }
};

----------------==  GtkColorButton
----------------==  GtkColorSelection
----------------==  GtkCombo
Gtk224.GtkCombo.child_property = { ["internal_child"] = {__type__="gchar*"   ,__default__ = "NULL"}};

Gtk224.GtkCombo.property["enable_arrow_keys"]["__gencode__"] = {"gtk_combo_set_use_arrows((GtkCombo*)({* id *}), (gboolean)({* property.value *}))"};
Gtk224.GtkCombo.property["enable_arrows_always"]["__gencode__"] = {"gtk_combo_set_use_arrows_always((GtkCombo*)({* id *}), (gboolean)({* property.value *}))"};
Gtk224.PatchGlibProperty(Gtk224.GtkCombo, {"allow_empty"});

--- 增加一个辅助类
Gtk224.GtkComboChildEntry = {
  class = "GtkComboChildEntry", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "((GtkCombo*)({* parent.property.id.value *})->entry", 
            params = { type = {"gboolean"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gboolean", macro_code = {uiheaders = "COMBO_CHILD_ENTRY_DEFINE"}},
  },
  parent = Gtk224.GtkEntry,
};
Gtk224.GtkCombo.packing = {
  {
      -- 如果是内部GtkEntry，则不需要关联代码
      group = {"internal_child"}, group_code = { { name = {"internal_child"},  gen_code = ""}},
  },
};

----------------==  GtkComboBoxEntry
-- 需要删除GtkComboBoxEntry的构建函数new_text
Gtk224.GtkComboBoxEntry.constructor.new_text = nil;

----------------==  GtkComboBoxText
-- GtkComboBoxText的构建函数new_with_entry需要patch
Gtk224.GtkComboBoxText.constructor.new_with_entry.params = { type = {"gboolean"}, name = {"has_entry"} };
---  GtkComboBoxText，需要增加一个正则属性处理
Gtk224.GtkComboBoxText.property["^text_item_%d+$"] = {__type__="gchar*", regex = true,
                              __gencode__ = {"gtk_combo_box_text_append_text((GtkComboBoxText*){* id *}, (gchar*){* property.value *})"}};

----------------==  GtkDialog
Gtk224.GtkDialog.constructor.new_with_buttons = nil;
Gtk224.GtkDialog.child_property = { 
  internal_child       = {__type__="gchar*"},
};
-- GtkVBox如果带internal_child子属性，则不需要生成关联代码
Gtk224.GtkDialog["packing"] = {
  {
      -- 用于判断是否属于当前组
      group = {"internal_child"}, group_code = { { name = {"internal_child"}, can_skip = true, gen_code = ""}},
  },
};

--- 增加四个辅助类:
Gtk224.GtkDialogChildGtkVBox = {
  class = "GtkDialogChildGtkVBox", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_dialog_get_content_area((GtkDialog*){* this.dialog_id.value *})", 
            params = { type = {"GtkDialog*"}, name = {"dialog_id"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = {
    -- 属性名称  属性类型 缺省值 代码生成
    dialog_id            = {__type__="GtkDialog*", macro_code = {uiheaders = "DIALOG_CHILD_VBOX_DEFINE"}},
  },
  child_property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gchar*"},
    information          = {__type__="gboolean"},
  },
  packing = {
    {
        group = {"internal_child"}, group_code = {
            -- 需要忽略掉这些packing属性的配置
            { name = {"internal_child"}, gen_code = ""},
            { name = {}, filter_out = {"expand", "fill", "pack_type", "padding", "position"}, can_skip = true, gen_code = ""} }
    },
    {
        -- 忽略掉pack_type与position
        group = {"information"}, group_code = { { name = {"information", "expand", "fill", "padding"}, filter_out = {"pack_type", "position"}, 
            gen_code = "gtk_box_pack_start((GtkBox*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"}}
    },
  },
  parent = Gtk224.GtkVBox,
};
Gtk224.GtkDialogChildGtkBox = {
  class = "GtkDialogChildGtkBox", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_dialog_get_content_area((GtkDialog*){* this.dialog_id.value *})", 
            params = { type = {"GtkDialog*"}, name = {"dialog_id"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = {
    -- 属性名称  属性类型 缺省值 代码生成
    dialog_id            = {__type__="GtkDialog*", macro_code = {uiheaders = "DIALOG_CHILD_BOX_DEFINE"}},
  },
  child_property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gchar*"},
    information          = {__type__="gboolean"},
  },
  packing = {
    {
        group = {"internal_child"}, group_code = { { name = {"internal_child"}, gen_code = ""}},
    },
    {
        group = {"information"}, group_code = { { name = {"information", "expand", "fill", "padding"}, 
            gen_code = "gtk_box_pack_start((GtkBox*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"}
        }
    },
  },
  parent = Gtk224.GtkBox,
};

Gtk224.GtkDialogChildGtkHButtonBox = {
  class = "GtkDialogChildGtkHButtonBox", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_dialog_get_action_area((GtkDialog*){* this.dialog_id.value *})", 
            params = { type = {"GtkDialog*"}, name = {"dialog_id"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = {
    -- 属性名称  属性类型 缺省值 代码生成
    dialog_id            = {__type__="GtkDialog*", macro_code = {uiheaders = "DIALOG_CHILD_HBUTTON_BOX_DEFINE"}},
  },
  child_property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    response             = {__type__="gboolean"},
    dialog_id            = {__type__="GtkDialog*"},
  },
  packing = {
    {
        -- 用于判断是否属于当前组，"secondary"属性现在可以自动递归时处理了
        group = {"response", "dialog_id"},                  -- 需要忽略掉这些packing属性的配置
        group_code = { { name = {"response", "dialog_id"}, filter_out = {"expand", "fill", "pack_type", "padding", "position"},
            gen_code = "gtk_dialog_add_action_widget((GtkDialog*){* packing.dialog_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.response.value *})"},
        },
    },
  },
  parent = Gtk224.GtkHButtonBox,
};
Gtk224.GtkDialogChildGtkButtonBox = {
  class = "GtkDialogChildGtkButtonBox", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_dialog_get_action_area((GtkDialog*){* this.dialog_id.value *})", 
            params = { type = {"GtkDialog*"}, name = {"dialog_id"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = {
    -- 属性名称  属性类型 缺省值 代码生成
    dialog_id            = {__type__="GtkDialog*", macro_code = {uiheaders = "DIALOG_CHILD_BUTTON_BOX_DEFINE"}},
  },
  child_property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    response             = {__type__="gboolean"},
    dialog_id            = {__type__="GtkDialog*"},
  },
  packing = {
    {
        -- 用于判断是否属于当前组，"secondary"属性现在可以自动递归时处理了
        group = {"response", "dialog_id"},                  -- 需要忽略掉这些packing属性的配置
        group_code = { { name = {"response", "dialog_id"}, filter_out = {"expand", "fill", "pack_type", "padding", "position"}, 
            gen_code = "gtk_dialog_add_action_widget((GtkDialog*){* packing.dialog_id.value *}, (GtkWidget*){* child.id.value *}, {* packing.response.value *})"},
        },
    },
  },
  parent = Gtk224.GtkButtonBox,
};

----------------==  GtkFileChooserButton
-- 判断构造函数的顺序，new_with_dialog需要首先判断
Gtk224.GtkFileChooserButton.constructor.__sort__ = {
    "new_with_dialog", 
    "new_with_backend",
    "new"
};
Gtk224.GtkFileChooserButton.constructor.new_with_backend = { gencode = "gtk_file_chooser_button_new_with_backend((const gchar*)({* this.title.value *}), (GtkFileChooserAction)({* this.action.value *}), (const gchar*)({* this.file_system_backend.value *}))",
                                           params = { type = {"const gchar*", "GtkFileChooserAction", "const gchar*"}, 
                                                    name = {"title", "action", "file_system_backend"}}};

----------------==  GtkFileChooserWidget
Gtk224.GtkFileChooserWidget.constructor.new_with_backend = { gencode = "gtk_file_chooser_button_new_with_backend((const gchar*)({* this.title.value *}), (GtkFileChooserAction)({* this.action.value *}), (const gchar*)({* this.file_system_backend.value *}))",
                                            params = { type = {"GtkFileChooserAction", "const gchar*"}, 
                                                    name = {"action", "file_system_backend"}}};

----------------==  GtkFontButton
-- GtkFontButton的构建函数
Gtk224.GtkFontButton.constructor["new_with_font"] = { gencode = "gtk_font_button_new_with_font((const gchar*)({* this.font_name.value *}))",
												  params = { type = {"gchar*"}, name = {"font_name"} } };


----------------==  GtkFontSelection
----------------==  GtkGammaCurve
----------------==  GtkHButtonBox
----------------==  GtkInfoBar
Gtk224.GtkInfoBar.constructor.new_with_buttons = nil;
-- 子属性，用于区分packing
Gtk224.GtkInfoBar.child_property = { 
    -- 属性名称  属性类型 缺省值
    action_area    = {__type__="guint"},
    content_area   = {__type__="guint"},
    -- 这个响应ID，允许有默认值，为0
    response       = {__type__="guint"  ,__default__ = "0" },
};

-- 另外的构建属性则继承自Gtk224的GtkBox的packing属性
Gtk224.GtkInfoBar.packing = Gtk224.copy_and_insert_more(Gtk224.GtkBox.packing, -- Gtk224.GtkInfoBar.parent.packing,
    -- 添加其他的匹配关系
    {
        group = {"action_area", "response"}, group_code = { { name = {"action_area", "response"}, 
            gen_code = "gtk_info_bar_add_action_widget((GtkInfoBar*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.response.value *})"}
        }
    },
    {
        group = {"content_area"}, group_code = { { name = {"content_area", "expand", "fill", "padding"}, 
            gen_code = "gtk_box_pack_start((GtkBox*)gtk_info_bar_get_content_area({* id *}), (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"}
        }
    }
);

----------------==  GtkLinkButton
----------------==  GtkListItem
Gtk224.GtkListItem.constructor.new_with_label = nil;

----------------==  GtkMenuItem
-- GtkMenuItem的构建函数不需要修改，其params需要添加一项
Gtk224.GtkMenuItem.constructor.new_with_mnemonic.params = { type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} };
-- GtkMenuItem的child property属性生成代码，在这里使用gtk_container_add
Gtk224.GtkMenuItem["packing"] = {
    {
        group = {}, group_code = { {name = {}, 
            gen_code = "gtk_menu_item_set_submenu((GtkMenuItem*)({* id *}), (GtkWidget*){* child.id.value *})"}}
    },
};
----------------==  GtkOffscreenWindow
----------------==  GtkOptionMenu
----------------==  GtkPlug
Gtk224.GtkPlug.constructor = {
    new             = { gencode = "gtk_plug_new((GdkWindow*)({* this.socket_window.value *}))",
                        params = { type = {"GdkWindow*"}, name = {"socket_window"} } }
};

----------------==  GtkRecentChooserMenu
--  GtkRecentChooserMenu ，属性来自于GtkRecentChooser
Gtk224.GtkRecentChooserMenu.constructor.new_for_manager = { gencode = "gtk_recent_chooser_menu_new_for_manager((GtkRecentManager*)({* this.recent_manager.value *}))", 
                                                    params = { type = {"GtkRecentManager*"}, name = {"recent_manager"} } };

----------------==  GtkRecentChooserWidget
--  GtkRecentChooserWidget ，属性来自于GtkRecentChooser
Gtk224.GtkRecentChooserWidget.constructor.new_for_manager = { gencode = "gtk_recent_chooser_widget_new_for_manager((GtkRecentManager*)({* this.recent_manager.value *}))", 
                                                    params = { type = {"GtkRecentManager*"}, name = {"recent_manager"} } };

----------------==  GtkScaleButton
Gtk224.GtkScaleButton.constructor.new = { gencode = "gtk_scale_button_new((GtkIconSize)({* this.size.value *}), (gdouble)(0), (gdouble)(0), (gdouble)(0), (const gchar**)(NULL))", 
                                          params = { type = {"GtkIconSize"}, 
                                                    name = {"size"} } };
Gtk224.GtkScaleButton.constructor.new_with_adj_icons = { gencode = "gtk_scale_button_new((GtkIconSize)({* this.size.value *}), (gdouble)gtk_adjustment_get_lower({* this.adjustment.value *}), (gdouble)gtk_adjustment_get_upper({* this.adjustment.value *}), (gdouble)gtk_adjustment_get_step_increment({* this.adjustment.value *}), (const gchar**)(NULL))", 
                                          params = { type = {"GtkIconSize", "GtkAdjustment*"}, 
                                                    name = {"size", "adjustment"} } };
Gtk224.GtkScaleButton.property.icons.__gencode__ = {"{ //",
                                                    "    const char* {* id *}_icons[] = { {* property.value *}, NULL}",
                                                    "    gtk_scale_button_set_icons((GtkScaleButton*)({* id *}), (const gchar**)({* id *}_icons))",
                                                    "} //"};
Gtk224.PatchGlibProperty(Gtk224.GtkScaleButton, {"size"});

----------------==  GtkSeparatorToolItem
----------------==  GtkStatusbar
----------------==  GtkToggleButton
-- GtkToggleButton需要增加draw_indicator的gencode属性
Gtk224.GtkToggleButton.constructor.new_with_mnemonic.params = {type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} };

Gtk224.GtkToggleButton.property["draw_indicator"]["__gencode__"] = {"gtk_toggle_button_set_mode((GtkToggleButton*){* id *}, (gboolean){* property.value *})"}

----------------==  GtkToolButton
----------------==  GtkVButtonBox
----------------==  GtkAboutDialog
Gtk224.GtkAboutDialog.property.artists.__gencode__ = {"{ //",
                                                      "    const char* {* id *}_artists[] = { {* property.value *}, NULL}",
                                                      "    gtk_about_dialog_set_artists((GtkAboutDialog*)({* id *}), (const gchar**)({* id *}_artists))",
                                                      "} //"};
Gtk224.GtkAboutDialog.property.authors.__gencode__ = {"{ //",
                                                      "    const char* {* id *}_authors[] = { {* property.value *}, NULL}",
                                                      "    gtk_about_dialog_set_authors((GtkAboutDialog*)({* id *}), (const gchar**)({* id *}_authors))",
                                                      "} //"};
Gtk224.GtkAboutDialog.property.documenters.__gencode__ = {"{ //",
                                                          "    const char* {* id *}_documenters[] = { {* property.value *}, NULL}",
                                                          "    gtk_about_dialog_set_documenters((GtkAboutDialog*)({* id *}), (const gchar**)({* id *}_documenters))",
                                                          "} //"};

----------------==  GtkCheckButton
Gtk224.GtkCheckButton.constructor.new_with_mnemonic.params = { type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} };

----------------==  GtkCheckMenuItem
Gtk224.GtkCheckMenuItem.constructor.new_with_mnemonic.params = { type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} };

----------------==  GtkColorSelectionDialog
--- 增加两个辅助类
Gtk224.GtkColorSelDlgButton = {
  class = "GtkColorSelDlgButton", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "GTK_GET_PROPERTY_WIDGET((GtkWidget*)({* parent.property.id.value *}), (const gchar*)({* this.internal_child.value *}))", 
            params = { type = {"const gchar*"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gchar*", macro_code = {uiheaders = "COLOR_SEL_BUTTON_DEFINE", uisources = "GTK_GET_PROPERTY_WIDGET"}},
  },
  parent = Gtk224.GtkButton,
};
Gtk224.GtkColorSelectionInterChild = {
  class = "GtkColorSelectionInterChild", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_color_selection_dialog_get_color_selection((GtkColorSelectionDialog*)({* parent.property.id.value *}) )", 
            params = { type = {"const gchar*"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gchar*", macro_code = {uiheaders = "COLOR_SEL_INTER_CHILD_DEFINE"}},
  },
  parent = Gtk224.GtkColorSelection,
};
-- 拷贝父类的父子关联
Gtk224.GtkColorSelectionDialog["packing"] = {
    {
        -- internal_child组，不需要建立父子关联
        group = {"internal_child"}, group_code = { {name = {"internal_child"}, can_skip = true, gen_code = ""}},
    },
    {
        -- 用于判断是否属于当前组
        group = {"response"}, group_code = {
            { name = {"response"}, 
              gen_code = "gtk_dialog_add_action_widget((GtkDialog*){* id *}, (GtkWidget*){* child.id.value *}, {* packing.response.value *})"},
            { name = {"position"}, can_skip = true,
              gen_code = "gtk_box_reorder_child((GtkBox*)gtk_dialog_get_action_area((GtkDialog*){* id *}), (GtkWidget*){* child.id.value *}, {* packing.position.value *})"},
        },
    }, 
    {
        -- 用于判断是否属于当前组
        group = {"information"}, group_code = {
            { name = {"information", "expand", "fill", "padding"}, 
              gen_code = "gtk_box_pack_start((GtkBox*)gtk_dialog_get_content_area({* id *}), (GtkWidget*){* child.id.value *}, {* packing.expand.value *}, {* packing.fill.value *}, {* packing.padding.value *})"}
        },
    },
};

----------------==  GtkFileChooserDialog
Gtk224.GtkFileChooserDialog.constructor.new.gencode = "gtk_file_chooser_dialog_new((const gchar*)({* this.title.value *}), (GtkWindow*)({* this.parent.value *}), (GtkFileChooserAction)({* this.action.value *}), NULL, 0)";
Gtk224.GtkFileChooserDialog.constructor.new_with_backend = { gencode = "gtk_file_chooser_button_new_with_backend((const gchar*)({* this.title.value *}), (GtkFileChooserAction)({* this.action.value *}), (const gchar*)({* this.file_system_backend.value *}))",
                                            params = { type = {"const gchar*", "GtkWindow*", "GtkFileChooserAction", "const gchar*"}, 
                                                    name = {"title", "parent", "action", "file_system_backend"}}};

----------------==  GtkFileSelection
Gtk224.GtkFileSelection.property["show_fileops"]["__gencode__"] = {
    "if ({* property.value *})) {//",
    "    gtk_file_selection_show_fileop_buttons((GtkFileSelection*){* id *})",
    "} else {//",
    "    gtk_file_selection_hide_fileop_buttons((GtkFileSelection*){* id *})",
    "}//"
};

----------------==  GtkFontSelectionDialog
--- 增加两个辅助类
Gtk224.GtkFontSelDlgButton = {
  class = "GtkFontSelDlgButton", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_font_selection_dialog_get_{* this.internal_child.value *}((GtkFontSelectionDialog*)({* parent.property.id.value *}))", 
            params = { type = {"gint"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gint", macro_code = {uiheaders = "FONT_SEL_BUTTON_DEFINE"}},
  },
  parent = Gtk224.GtkButton,
};
Gtk224.GtkFontSelectionInterChild = {
  class = "GtkFontSelectionInterChild", 
  constructor = { 
    -- 名称[- ==> _], 
    new = { gencode = "gtk_font_selection_dialog_get_font_selection((GtkFontSelectionDialog*)({* parent.property.id.value *}) )", 
            params = { type = {"const gchar*"}, name = {"internal_child"} } },
  },
  signal = { 
    -- 信号名称[- ==> _], 信号返回值, 信号参数列表
  },
  property = { 
    -- 属性名称  属性类型 缺省值 代码生成
    internal_child       = {__type__="gchar*", macro_code = {uiheaders = "FONT_SEL_INTER_CHILD_DEFINE"}},
  },
  parent = Gtk224.GtkFontSelection,
};
Gtk224.GtkFontSelectionDialog["packing"] = Gtk224.GtkColorSelectionDialog["packing"];

----------------==  GtkImageMenuItem
-- 需要修改生成代码，且变更过滤器
Gtk224.GtkImageMenuItem.constructor.new_from_stock = {
    gencode = "gtk_image_menu_item_new_from_stock((const gchar*)({* this.label.value *}), (GtkAccelGroup*)({* this.accel_group.value *}))", 
    params = { type = {"const gchar*", "GtkAccelGroup*", "gboolean"}, 
               name = {"label", "accel_group", "use_stock"} } 
};
Gtk224.GtkImageMenuItem.constructor.new_from_stock2 = {
  gencode = "gtk_image_menu_item_new_from_stock((const gchar*)({* this.label.value *}), (GtkAccelGroup*)(NULL))", 
  params = { type = {"const gchar*", "gboolean"},  name = {"label", "use_stock"} } 
};
-- 不修改生成代码，只变更过滤器器
Gtk224.GtkImageMenuItem.constructor.new_with_mnemonic.params = { type = {"const gchar*", "gboolean"}, name = {"label", "use_underline"} };
-- 判断构造函数的顺序
Gtk224.GtkImageMenuItem.constructor.__sort__ = {
  "new_from_stock", 
  "new_from_stock2", -- new_from_stock2必须在new_with_mnemonic之前
  "new_with_mnemonic",
  "new_with_label",
  "new"
};

----------------==  GtkInputDialog

----------------==  GtkMenuToolButton
----------------==  GtkMessageDialog
Gtk224.GtkMessageDialog.constructor = {
  -- 名称[- ==> _], 
  new             = { gencode = "gtk_message_dialog_new((GtkWindow*)(NULL), GTK_DIALOG_DESTROY_WITH_PARENT, (GtkMessageType)({* this.message_type.value *}), (GtkButtonsType)({* this.buttons.value *}), (const gchar*)({* this.text.value *}))", 
          params = { type = {"GtkMessageType", "GtkButtonsType", "gchar*"}, 
                      name = {"message_type", "buttons", "text"} } },
  new_with_markup = { gencode = "gtk_message_dialog_new_with_markup((GtkWindow*)(NULL), GTK_DIALOG_DESTROY_WITH_PARENT, (GtkMessageType)({* this.message_type.value *}), (GtkButtonsType)({* this.buttons.value *}), (const gchar*)({* this.text.value *}))", 
          params = { type = {"GtkWindow*", "GtkMessageType", "GtkButtonsType", "gchar*", "gboolean"}, 
                     name = {"message_type", "buttons", "text", "use_markup"} } },
};
Gtk224.PatchGlibProperty(Gtk224.GtkMessageDialog, {"use_markup", "secondary_text", "secondary_use_markup"});

----------------==  GtkRecentChooserDialog
Gtk224.GtkRecentChooserDialog.constructor.new.gencode = "gtk_recent_chooser_dialog_new((const gchar*)({* this.title.value *}), (GtkWindow*)({* this.parent.value *}), (const gchar*)(NULL), 0)";
Gtk224.GtkRecentChooserDialog.constructor.new_for_manager = { gencode = "gtk_recent_chooser_dialog_new_for_manager((const gchar*)({* this.title.value *}), (GtkWindow*)({* this.parent.value *}), (GtkRecentManager*)({* this.manager.value *}), (const gchar*)(NULL), 0)", 
                                                              params = { type = {"const gchar*", "GtkWindow*", "GtkRecentManager*"}, 
                                                                        name = {"title", "parent", "manager"} } };

----------------==  GtkSeparatorMenuItem
----------------==  GtkTearoffMenuItem
----------------==  GtkToggleToolButton
----------------==  GtkVolumeButton
----------------==  GtkRadioButton
Gtk224.GtkRadioButton.property["group"]["__gencode__"]  = {"gtk_radio_button_set_group((GtkRadioButton*)({* id *}), (GSList*)gtk_radio_button_get_group({* property.value *}))"}

Gtk224.GtkRadioButton.constructor = {
  -- 名称[- ==> _],
  new                           = {gencode = "gtk_radio_button_new((GSList*)(0))", 
          params = { type = {}, 
                    name = {} } },
  new_from_widget              = { gencode = "gtk_radio_button_new_from_widget((GtkRadioButton*)({* this.group.value *}))",
          params = { type = {"GtkRadioButton*"},
                    name = {"group"} } },
  new_with_label                = { gencode = "gtk_radio_button_new_with_label((GSList*)(0), (const gchar*)({* this.label.value *}))",
          params = { type = {"const gchar*"},
                      name = {"label"} } },
  new_with_label_from_widget    = { gencode = "gtk_radio_button_new_with_label_from_widget((GtkRadioButton*)({* this.group.value *}), (const gchar*)({* this.label.value *}))",
          params = { type = {"GtkRadioButton*", "const gchar*"},
                     name = {"group", "label"} } },
  new_with_mnemonic             = { gencode = "gtk_radio_button_new_with_mnemonic((GSList*)(0), (const gchar*)({* this.label.value *}))",
          params = { type = {"const gchar*", "gboolean"},
                    name = {"label", "use_underline"}} },
  new_with_mnemonic_from_widget = { gencode = "gtk_radio_button_new_with_mnemonic_from_widget((GtkRadioButton*)({* this.group.value *}), (const gchar*)({* this.label.value *}))",
          params = { type = {"GtkRadioButton*", "const gchar*", "gboolean"},
                     name = {"group", "label", "use_underline"}} },
};

----------------==  GtkRadioMenuItem
Gtk224.GtkRadioMenuItem.property["group"]["__gencode__"]  = {"gtk_radio_menu_item_set_group((GtkRadioMenuItem*)({* id *}), (GSList*)gtk_radio_menu_item_get_group({* property.value *}))"}

Gtk224.GtkRadioMenuItem.constructor = {
  -- 名称[- ==> _],
  new                           = {gencode = "gtk_radio_menu_item_new((GSList*)(0))", 
          params = { type = {}, 
                    name = {} } },
  new_from_widget              = { gencode = "gtk_radio_menu_item_new_from_widget((GtkRadioMenuItem*)({* this.group.value *}))",
          params = { type = {"GtkRadioMenuItem*"},
                    name = {"group"} } },
  new_with_label                = { gencode = "gtk_radio_menu_item_new_with_label((GSList*)(0), (const gchar*)({* this.label.value *}))",
          params = { type = {"const gchar*"},
                      name = {"label"} } },
  new_with_label_from_widget    = { gencode = "gtk_radio_menu_item_new_with_label_from_widget((GtkRadioMenuItem*)({* this.group.value *}), (const gchar*)({* this.label.value *}))",
          params = { type = {"GtkRadioMenuItem*", "const gchar*"},
                     name = {"group", "label"} } },
  new_with_mnemonic             = { gencode = "gtk_radio_menu_item_new_with_mnemonic((GSList*)(0), (const gchar*)({* this.label.value *}))",
          params = { type = {"const gchar*", "gboolean"},
                    name = {"label", "use_underline"}} },
  new_with_mnemonic_from_widget = { gencode = "gtk_radio_menu_item_new_with_mnemonic_from_widget((GtkRadioMenuItem*)({* this.group.value *}), (const gchar*)({* this.label.value *}))",
          params = { type = {"GtkRadioMenuItem*", "const gchar*", "gboolean"},
                     name = {"group", "label", "use_underline"}} },
};

----------------==  GtkRadioToolButton
Gtk224.GtkRadioToolButton.property["group"]["__gencode__"]  = {"gtk_radio_tool_button_set_group((GtkRadioToolButton*)({* id *}), (GSList*)gtk_radio_tool_button_get_group({* property.value *}))"}

Gtk224.GtkRadioToolButton.constructor = {
  -- 名称[- ==> _],
  new                            = {gencode = "gtk_radio_tool_button_new((GSList*)(0))", 
          params = { type = {}, 
                    name = {} } },
  new_from_stock                 = { gencode = "gtk_radio_tool_button_new_from_stock((GSList*)(0), (const gchar*)({* this.stock_id.value *}))",
          params = { type = {"const gchar*"},
                    name = {"stock_id"} } },
  new_from_widget                = { gencode = "gtk_radio_tool_button_new_from_widget((GtkRadioToolButton*)({* this.group.value *}))",
          params = { type = {"GtkRadioToolButton*"},
                      name = {"group"} } },
  new_with_stock_from_widget     = { gencode = "gtk_radio_tool_button_new_with_stock_from_widget((GtkRadioToolButton*)({* this.group.value *}), (const gchar*)({* this.label.value *}))",
          params = { type = {"GtkRadioToolButton*", "const gchar*"},
                     name = {"group", "stock_id"} } },
};

----------------========================

---------------------  GtkTmplWidget示例，所有的模板类都格式与这个类相同，用于生成模板类的代码
--[[
Gtk224.GtkTmplWidget = {
  class = "GtkTmplWidget",
  constructor = {
    -- 名称[- ==> _], 
    new = { gencode = "TMPL_WIDGET({* id *})", 
            params = { type = {}, name = {} } },
  },
  signal = {
      -- 信号名称[- ==> _]， 信号返回值, 信号参数列表
  },
  property = {
    -- 属性名称  属性类型 缺省值 代码生成
    __parent_class__ = {__type__="gchar*" ,  __default__ = "NULL", __gencode__ = ""},
  },
  parent = nil,
};
]]--

------------------------  属性补丁，如下属性，依赖顶层控件，需要增加一个属性
Gtk224.GtkActivatable.property.related_action.is_top_widget = true;
Gtk224.GtkEntryCompletion.property.model.is_top_widget = true;
Gtk224.GtkPrintOperation.property.default_page_setup.is_top_widget = true;
Gtk224.GtkPrintOperation.property.print_settings.is_top_widget = true;
Gtk224.GtkTextBuffer.property.tag_table.is_top_widget = true;
Gtk224.GtkTreeModelSort.property.model.is_top_widget = true;
Gtk224.GtkRadioAction.property.group.is_top_widget = true;
Gtk224.GtkCellRendererCombo.property.model.is_top_widget = true;
Gtk224.GtkCellRendererSpin.property.adjustment.is_top_widget = true;
Gtk224.GtkIconView.property.model.is_top_widget = true;
Gtk224.GtkLayout.property.hadjustment.is_top_widget = true;
Gtk224.GtkLayout.property.vadjustment.is_top_widget = true;
Gtk224.GtkProgressBar.property.adjustment.is_top_widget = true;
Gtk224.GtkSpinButton.property.adjustment.is_top_widget = true;
Gtk224.GtkTextView.property.buffer.is_top_widget = true;
Gtk224.GtkTreeView.property.expander_column.is_top_widget = true;
Gtk224.GtkTreeView.property.hadjustment.is_top_widget = true;
Gtk224.GtkTreeView.property.model.is_top_widget = true;
Gtk224.GtkTreeView.property.vadjustment.is_top_widget = true;
Gtk224.GtkComboBox.property.model.is_top_widget = true;
Gtk224.GtkScrolledWindow.property.hadjustment.is_top_widget = true;
Gtk224.GtkScrolledWindow.property.vadjustment.is_top_widget = true;
Gtk224.GtkViewport.property.hadjustment.is_top_widget = true;
Gtk224.GtkViewport.property.vadjustment.is_top_widget = true;
Gtk224.GtkFileChooserButton.property.dialog.is_top_widget = true;
Gtk224.GtkScaleButton.property.adjustment.is_top_widget = true;
Gtk224.GtkEntry.property.buffer.is_top_widget = true;
Gtk224.GtkFileChooser.property.filter.is_top_widget = true;

-- 增加ext_depend属性，表示该属性需要依赖其他控件（有可能是顶层控件，也有可能是其他子控件）
Gtk224.GtkActivatable.property.related_action.ext_depend = true;
Gtk224.GtkEntryCompletion.property.model.ext_depend = true;
Gtk224.GtkPrintOperation.property.default_page_setup.ext_depend = true;
Gtk224.GtkPrintOperation.property.print_settings.ext_depend = true;
Gtk224.GtkTextBuffer.property.tag_table.ext_depend = true;
Gtk224.GtkTreeModelSort.property.model.ext_depend = true;
Gtk224.GtkRadioAction.property.group.ext_depend = true;
Gtk224.GtkCellRendererCombo.property.model.ext_depend = true;
Gtk224.GtkCellRendererSpin.property.adjustment.ext_depend = true;
Gtk224.GtkIconView.property.model.ext_depend = true;
Gtk224.GtkLayout.property.hadjustment.ext_depend = true;
Gtk224.GtkLayout.property.vadjustment.ext_depend = true;
Gtk224.GtkProgressBar.property.adjustment.ext_depend = true;
Gtk224.GtkSpinButton.property.adjustment.ext_depend = true;
Gtk224.GtkTextView.property.buffer.ext_depend = true;
Gtk224.GtkTreeView.property.expander_column.ext_depend = true;
Gtk224.GtkTreeView.property.hadjustment.ext_depend = true;
Gtk224.GtkTreeView.property.model.ext_depend = true;
Gtk224.GtkTreeView.property.vadjustment.ext_depend = true;
Gtk224.GtkComboBox.property.model.ext_depend = true;
Gtk224.GtkScrolledWindow.property.hadjustment.ext_depend = true;
Gtk224.GtkScrolledWindow.property.vadjustment.ext_depend = true;
Gtk224.GtkViewport.property.hadjustment.ext_depend = true;
Gtk224.GtkViewport.property.vadjustment.ext_depend = true;
Gtk224.GtkFileChooserButton.property.dialog.ext_depend = true;
Gtk224.GtkScaleButton.property.adjustment.ext_depend = true;
Gtk224.GtkEntry.property.buffer.ext_depend = true;
Gtk224.GtkFileChooser.property.filter.ext_depend = true;

------------------------  属性补丁，如下属性，生成的代码中，需要在所有函数声明前增加一个统一的补丁函数
Gtk224.GtkActivatable.property.related_action.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkEntryCompletion.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkPrintOperation.property.default_page_setup.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkPrintOperation.property.print_settings.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTextBuffer.property.tag_table.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeModelSort.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkRadioAction.property.group.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkCellRendererCombo.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkCellRendererSpin.property.adjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkIconView.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkLayout.property.hadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkLayout.property.vadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkProgressBar.property.adjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkSpinButton.property.adjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTextView.property.buffer.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeView.property.expander_column.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeView.property.hadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeView.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkTreeView.property.vadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkComboBox.property.model.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkScrolledWindow.property.hadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkScrolledWindow.property.vadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkViewport.property.hadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkViewport.property.vadjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkFileChooserButton.property.dialog.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkScaleButton.property.adjustment.macro_code = {uisources = "TOP_WIDGET"};
Gtk224.GtkFileChooser.property.filter.macro_code = {uisources = "TOP_WIDGET"};

Gtk224.GtkTextTag.property.background_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkTextTag.property.foreground_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkTextTag.property.paragraph_background_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkCellRenderer.property.cell_background_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkCellRendererText.property.background_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkCellRendererText.property.foreground_gdk.macro_code = {uisources = "GDK_COLOR"};
-- 这个允许为NULL
Gtk224.GtkCellView.property.background.macro_code = {uisources = "GDK_COLOR2"};
Gtk224.GtkCellView.property.background_gdk.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkColorButton.property.color.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkColorButton.property.color.macro_code = {uisources = "GDK_COLOR"};
Gtk224.GtkColorSelection.property.current_color.macro_code = {uisources = "GDK_COLOR"};

Gtk224.GtkEntry.property.buffer.macro_code = {uisources = "TOP_WIDGET"};

Gtk224.GtkStatusIcon.property.pixbuf.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkCellRendererPixbuf.property.pixbuf.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkCellRendererPixbuf.property.pixbuf_expander_closed.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkCellRendererPixbuf.property.pixbuf_expander_open.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkEntry.property["primary_icon_pixbuf"]["macro_code"] = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkEntry.property["secondary_icon_pixbuf"]["macro_code"] = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkImage.property.pixbuf.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkWindow.property.icon.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkAssistant.child_property.header_image.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkAssistant.child_property.sidebar_image.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};
Gtk224.GtkAboutDialog.property.logo.macro_code = {uisources = "GTK_LOAD_GDK_PIX_BUF"};

---- 末尾处，表的拷贝函数不再需要了
Gtk224.PatchGlibProperty = nil;
Gtk224.insert_more = nil;
Gtk224.copy_and_insert_more = nil;
Gtk224.table_copy_table_in_patch = nil;
